lkml.org 
[lkml]   [2011]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] fix bad delta time values in /proc/timer_list
From
On Tue, Jan 18, 2011 at 4:20 AM, Shaffer, Scott <scott.shaffer@ccur.com> 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@ccur.com>

Looks good.

Reviewed-by: Yong Zhang <yong.zhang0@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-01-18 06:51    [W:0.027 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site