From: Michael Jones <michael.jones@matrix-vision.de>
To: linux-omap@vger.kernel.org
Subject: timing in driver function
Date: Mon, 01 Aug 2011 17:15:26 +0200 [thread overview]
Message-ID: <4E36C30E.9060809@matrix-vision.de> (raw)
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.
2. Using the ARM core's Performance Monitor Count Registers. This seems
to be what perf_event uses. I'm not familiar with perf_events, but it
sounds like I would also need to build 'perf', which according to
http://www.omappedia.org/wiki/Using_perf isn't possible to
cross-compile. I don't want to tackle that without some reassurance that
it is the right/only way.
I am currently using a 2.6.38 kernel.
thanks,
Michael
MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Erhard Meier
next reply other threads:[~2011-08-01 15:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-01 15:15 Michael Jones [this message]
2011-08-01 15:34 ` timing in driver function Gadiyar, Anand
2011-08-01 16:55 ` C.A, Subramaniam
2011-08-02 1:41 ` Paul Walmsley
2011-08-05 12:06 ` Michael Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E36C30E.9060809@matrix-vision.de \
--to=michael.jones@matrix-vision.de \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox