On 3/18/12 6:08 AM, Bernie Pope wrote:
Hello,
I'm writing a tool to parse the perf.data output of perf and was wondering
about the source of the timestamps found in perf_sample events? Specifically I
mean the u64 time field in the perf_sample struct in util/event.h. I believe it
is in nanoseconds from a particular event (system start?), but I can't find any
documentation about where the time comes from.
I'm also interested in reading from this time source from a userspace program,
is that possible?
Did you get a response to this?
Code wise, you'll need to follow perf_clock(). I believe for x86 with a
stable TSC you end up in native_sched_clock() in arch/x86/kernel/tsc.c.
As for the corresponding userspace call I believe it is
clock_gettime(CLOCK_MONOTONIC, ...).
David
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html