From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751683AbeAPDqx (ORCPT + 1 other); Mon, 15 Jan 2018 22:46:53 -0500 Received: from terminus.zytor.com ([65.50.211.136]:56621 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbeAPDqs (ORCPT ); Mon, 15 Jan 2018 22:46:48 -0500 Date: Mon, 15 Jan 2018 19:43:27 -0800 From: tip-bot for Anna-Maria Gleixner Message-ID: Cc: hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, anna-maria@linutronix.de, torvalds@linux-foundation.org, peterz@infradead.org, hch@lst.de, john.stultz@linaro.org Reply-To: torvalds@linux-foundation.org, tglx@linutronix.de, anna-maria@linutronix.de, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, john.stultz@linaro.org, hch@lst.de, peterz@infradead.org In-Reply-To: <20171221104205.7269-9-anna-maria@linutronix.de> References: <20171221104205.7269-9-anna-maria@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account Git-Commit-ID: 91633eed73a3ac37aaece5c8c1f93a18bae616a9 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Commit-ID: 91633eed73a3ac37aaece5c8c1f93a18bae616a9 Gitweb: https://git.kernel.org/tip/91633eed73a3ac37aaece5c8c1f93a18bae616a9 Author: Anna-Maria Gleixner AuthorDate: Thu, 21 Dec 2017 11:41:37 +0100 Committer: Ingo Molnar CommitDate: Tue, 16 Jan 2018 02:35:45 +0100 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: Anna-Maria Gleixner Cc: Christoph Hellwig Cc: John Stultz Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: keescook@chromium.org Link: http://lkml.kernel.org/r/20171221104205.7269-9-anna-maria@linutronix.de Signed-off-by: Ingo Molnar --- include/trace/events/timer.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 16e305e..c6f7280 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -136,6 +136,20 @@ DEFINE_EVENT(timer_class, timer_cancel, 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: pointer to struct hrtimer @@ -162,10 +176,8 @@ TRACE_EVENT(hrtimer_init, ), TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer, - __entry->clockid == CLOCK_REALTIME ? - "CLOCK_REALTIME" : "CLOCK_MONOTONIC", - __entry->mode == HRTIMER_MODE_ABS ? - "HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL") + decode_clockid(__entry->clockid), + decode_hrtimer_mode(__entry->mode)) ); /**