Skip to content

Commit

Permalink
tracing: timer: Add deferrable flag to timer_start
Browse files Browse the repository at this point in the history
The timer_start event now shows whether the timer is
deferrable in case of a low-res timer. The debug_activate
function now includes a deferrable flag while calling
the trace_timer_start event.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
[jstultz: Fixed minor whitespace and grammer tweaks
 pointed out by Ingo]
Signed-off-by: John Stultz <john.stultz@linaro.org>
  • Loading branch information
Badhri Jagan Sridharan authored and John Stultz committed May 22, 2015
1 parent 57d05a9 commit 4e413e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions include/trace/events/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,32 @@ DEFINE_EVENT(timer_class, timer_init,
*/
TRACE_EVENT(timer_start,

TP_PROTO(struct timer_list *timer, unsigned long expires),
TP_PROTO(struct timer_list *timer,
unsigned long expires,
unsigned int deferrable),

TP_ARGS(timer, expires),
TP_ARGS(timer, expires, deferrable),

TP_STRUCT__entry(
__field( void *, timer )
__field( void *, function )
__field( unsigned long, expires )
__field( unsigned long, now )
__field( unsigned int, deferrable )
),

TP_fast_assign(
__entry->timer = timer;
__entry->function = timer->function;
__entry->expires = expires;
__entry->now = jiffies;
__entry->deferrable = deferrable;
),

TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld]",
TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld] defer=%c",
__entry->timer, __entry->function, __entry->expires,
(long)__entry->expires - __entry->now)
(long)__entry->expires - __entry->now,
__entry->deferrable > 0 ? 'y':'n')
);

/**
Expand Down
2 changes: 1 addition & 1 deletion kernel/time/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ static inline void
debug_activate(struct timer_list *timer, unsigned long expires)
{
debug_timer_activate(timer);
trace_timer_start(timer, expires);
trace_timer_start(timer, expires, tbase_get_deferrable(timer->base));
}

static inline void debug_deactivate(struct timer_list *timer)
Expand Down

0 comments on commit 4e413e8

Please sign in to comment.