Re: [RFC] [Patch 7/8] statistics infrastructure - exploitation prerequisite

From: Arnd Bergmann
Date: Tue May 16 2006 - 19:02:52 EST


Am Wednesday 17 May 2006 00:36 schrieb Martin Peschke:
> Any other hints on how to replace my sched_clock() calls are welcome.
> (I want to measure elapsed times in units that are understandable to
> users without hardware manuals and calculator, such as milliseconds.)

There are a number of APIs that allow you to get the time:

- do_gettimeofday
potentially slow, reliable TOD clock, microsecond resolution
- ktime_get_ts
monotonic clock, nanosecond resolution
- getnstimeofday
reliable, nanosecond TOD clock
- xtime
jiffie accurate TOD clock, with fast reads
- xtime + wall_to_monotonic
jiffie accurate monotonic clock, almost as fast
- get_cycles
highest supported resolution and accuracy, highly
HW-specific behaviour, may overflow.

Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/