Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91633eed authored by Anna-Maria Gleixner's avatar Anna-Maria Gleixner Committed by Ingo Molnar
Browse files

tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account



So far only CLOCK_MONOTONIC and CLOCK_REALTIME were taken into account as
well as HRTIMER_MODE_ABS/REL in the hrtimer_init tracepoint. The query for
detecting the ABS or REL timer modes is not valid anymore, it got broken
by the introduction of HRTIMER_MODE_PINNED.

HRTIMER_MODE_PINNED is not evaluated in the hrtimer_init() call, but for the
sake of completeness print all given modes.

Signed-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: keescook@chromium.org
Link: http://lkml.kernel.org/r/20171221104205.7269-9-anna-maria@linutronix.de


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 19b51cb5
Loading
Loading
Loading
Loading
+16 −4
Original line number Original line Diff line number Diff line
@@ -136,6 +136,20 @@ DEFINE_EVENT(timer_class, timer_cancel,
	TP_ARGS(timer)
	TP_ARGS(timer)
);
);


#define decode_clockid(type)						\
	__print_symbolic(type,						\
		{ CLOCK_REALTIME,	"CLOCK_REALTIME"	},	\
		{ CLOCK_MONOTONIC,	"CLOCK_MONOTONIC"	},	\
		{ CLOCK_BOOTTIME,	"CLOCK_BOOTTIME"	},	\
		{ CLOCK_TAI,		"CLOCK_TAI"		})

#define decode_hrtimer_mode(mode)					\
	__print_symbolic(mode,						\
		{ HRTIMER_MODE_ABS,		"ABS"		},	\
		{ HRTIMER_MODE_REL,		"REL"		},	\
		{ HRTIMER_MODE_ABS_PINNED,	"ABS|PINNED"	},	\
		{ HRTIMER_MODE_REL_PINNED,	"REL|PINNED"	})

/**
/**
 * hrtimer_init - called when the hrtimer is initialized
 * hrtimer_init - called when the hrtimer is initialized
 * @hrtimer:	pointer to struct hrtimer
 * @hrtimer:	pointer to struct hrtimer
@@ -162,10 +176,8 @@ TRACE_EVENT(hrtimer_init,
	),
	),


	TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer,
	TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer,
		  __entry->clockid == CLOCK_REALTIME ?
		  decode_clockid(__entry->clockid),
			"CLOCK_REALTIME" : "CLOCK_MONOTONIC",
		  decode_hrtimer_mode(__entry->mode))
		  __entry->mode == HRTIMER_MODE_ABS ?
			"HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL")
);
);


/**
/**