On Mon, Aug 1, 2011 at 10:34 AM, Gadiyar, Anand <gadiyar@xxxxxx> wrote: > Michael Jones wrote: >> I have a function in a driver which takes ~50ms to execute, which I've >> measured by reading jiffies at the beginning and end. But jiffies only >> counts at 128Hz on my system, so this was a very coarse measurement. Now >> I would like to find out more exactly where the time is going inside >> this function. So my basic question is, what is the best way to measure >> lapsed time with reasonable resolution on an OMAP? >> >> As I had done with the jiffies measurement, what I imagined was >> inserting lines into my function, sampling the value of some counter at >> various points within it. This approach is crude but simple and would >> suffice for my case. >> >> Since it must be a very common task, I thought I'd ask here what the >> recommended approach is. I see a few directions... >> >> 1. Using the OMAP's 32kHz timer, which is provided as a "struct >> clocksource". It seems like what I would want is to call >> clocksource_32k.read(), but I don't know how to retrieve clocksource_32k. >> > > If you're looking for a one-off profiling, then as a hack, you could > export a function that unconditionally returns the value of the 32kHz > timer's count register (32KSYNCNT_CR) and use that for profiling. > How about using GPT using dm-timer APIs? > - Anand > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Thank you and Regards Subbu -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html