[patch 10/20] timer: Add a cascading tracepoint

From: Thomas Gleixner
Date: Mon Jun 13 2016 - 04:49:36 EST


For analysis of the timer wheel its necessary to trace the cascading. Add a
tracepoint.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: rt@xxxxxxxxxxxxx
---
include/trace/events/timer.h | 11 +++++++++++
kernel/time/timer.c | 1 +
2 files changed, 12 insertions(+)

--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -126,6 +126,17 @@ DEFINE_EVENT(timer_class, timer_cancel,
);

/**
+ * timer_cascade - called when the timer is cascaded
+ * @timer: pointer to struct timer_list
+ */
+DEFINE_EVENT(timer_class, timer_cascade,
+
+ TP_PROTO(struct timer_list *timer),
+
+ TP_ARGS(timer)
+);
+
+/**
* hrtimer_init - called when the hrtimer is initialized
* @hrtimer: pointer to struct hrtimer
* @clockid: the hrtimers clock
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1099,6 +1099,7 @@ static int cascade(struct tvec_base *bas
* don't have to detach them individually.
*/
hlist_for_each_entry_safe(timer, tmp, &tv_list, entry) {
+ trace_timer_cascade(timer);
/* No accounting, while moving them */
__internal_add_timer(base, timer);
}