Re: [PATCH] fix bad delta time values in /proc/timer_list

From: Yong Zhang
Date: Tue Jan 18 2011 - 00:49:23 EST


On Tue, Jan 18, 2011 at 4:20 AM, Shaffer, Scott <scott.shaffer@xxxxxxxx> wrote:
> elapsed times printed from /proc/timer_list are incorrect for the
> CLOCK_REALTIME timer list.
>
> print_timer() is passed monotonic nsecs as current time, but should
> be passed monotonic nsecs + hrtimer_clock_base.offset for the
> timer list it is printing.
>
> This patch fixes CLOCK_REALTIME timer lists, and does not break
> CLOCK_MONOTONIC timer lists.
>
>
> This shows a thread's timer that is <10ms:
>
> xunil2.ccur.com # grep -A 9 "cpu: 1" /proc/timer_list
> cpu: 1
> Âclock 0:
> Â.base: Â Â Â f67031d0
> Â.index: Â Â Â0
> Â.resolution: 1 nsecs
> Â.get_time: Â ktime_get_real
> Â.offset: Â Â 1294953310697580572 nsecs
> active timers:
> Â#0: <f518ff3c>, hrtimer_wakeup, S:01, hrtimer_start_range_ns, pthread_sleep2/7067
> Â# expires at 1295021767185712301-1295021767185712301 nsecs [in 1294953310698070434 to 1294953310698070434 nsecs]
>
>
> With the patch below, that thread's timer looks like:
>
> Â#0: <f37d7f3c>, hrtimer_wakeup, S:01, hrtimer_start_range_ns, pthread_sleep2/9403
> Â# expires at 1295022944770566772-1295022944770566772 nsecs [in 5305914 to 5305914 nsecs]
>
>
> Signed-off-by: Scott Shaffer <scott.shaffer@xxxxxxxx>

Looks good.

Reviewed-by: Yong Zhang <yong.zhang0@xxxxxxxxx>
--
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/