diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-02-10 16:41:15 +0100 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-02-15 09:02:24 -0500 |
commit | 8a58a34ba479d42b3ef28f8ffd9e245a81a7786f (patch) | |
tree | 39b701b37b8f050d2c54dcf73ccb797db3105dd0 /include/trace/events/timer.h | |
parent | 1f9b3546cf4c273b6d809003244d05cf0460a5e9 (diff) | |
download | linux-8a58a34ba479d42b3ef28f8ffd9e245a81a7786f.tar.gz linux-8a58a34ba479d42b3ef28f8ffd9e245a81a7786f.tar.bz2 linux-8a58a34ba479d42b3ef28f8ffd9e245a81a7786f.zip |
timers: Make flags output in the timer_start tracepoint useful
The timer flags in the timer_start trace event contain lots of useful
information, but the meaning is not clear in the trace output. Making tools
rely on the bit positions is bad as they might change over time.
Decode the flags in the print out. Tools can retrieve the bits and their
meaning from the trace format file.
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1702101639290.4036@nanos
Requested-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include/trace/events/timer.h')
-rw-r--r-- | include/trace/events/timer.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 1448637616d6..f6d8fea6df77 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -36,6 +36,13 @@ DEFINE_EVENT(timer_class, timer_init, TP_ARGS(timer) ); +#define decode_timer_flags(flags) \ + __print_flags(flags, "|", \ + { TIMER_MIGRATING, "M" }, \ + { TIMER_DEFERRABLE, "D" }, \ + { TIMER_PINNED, "P" }, \ + { TIMER_IRQSAFE, "I" }) + /** * timer_start - called when the timer is started * @timer: pointer to struct timer_list @@ -65,9 +72,12 @@ TRACE_EVENT(timer_start, __entry->flags = flags; ), - TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld] flags=0x%08x", + TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld] cpu=%u idx=%u flags=%s", __entry->timer, __entry->function, __entry->expires, - (long)__entry->expires - __entry->now, __entry->flags) + (long)__entry->expires - __entry->now, + __entry->flags & TIMER_CPUMASK, + __entry->flags >> TIMER_ARRAYSHIFT, + decode_timer_flags(__entry->flags & TIMER_TRACE_FLAGMASK)) ); /** |