|
From: Todd P. <tp...@mv...> - 2005-03-18 03:35:39
|
Hello Amit --
> The sched_clock fucntion returns time in nanoseconds. It is defined for both
> 32K timer and MPU timer. Please let me know whether the the bitwise negation
> should be removed because I didn't see any "0 - omap_mpu_timer_read(0)".
>
> If we want the resolution in microseconds or milliseconds, we can multiply
> the value returned by sched_clock(). Please let me know.
>
>>From arch/arm/kernel/time.c
>
> unsigned long long __attribute__((weak)) sched_clock(void)
> {
> return (unsigned long long)jiffies * (1000000000 / HZ);
> }
Ah, I forgot they use nanoseconds resolution, I suppose we could convert
to keep the units reasonable for instrumentation purposes.
Note that the above is the jiffie-based (so actually
millisecond-resolution) default sched_clock() for ARM if a
higher-resolution version based on board-specific timers is not provided
(hence the "weak" attribute). See arch/arm/mach-omap/time.c for the MPU
Timer 1 based sched_clock for OMAPs (in recent OMAP tree).
Thanks,
--
Todd
|