Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2169006imm; Mon, 28 May 2018 03:06:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKG1AHEGG5sy7QBdsl1eM1WyijMz1ZcPoGbem1Gh/KvNjGakTpmyys57TrnwanJboL+7PHs X-Received: by 2002:a17:902:8bc6:: with SMTP id r6-v6mr8455899plo.257.1527501999309; Mon, 28 May 2018 03:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527501999; cv=none; d=google.com; s=arc-20160816; b=Jl0qY4mSpKQi7Sm+u61oGFZS0tSKMkR2V4BgdDjkP8C+iqQ7pNIJTLpYm9ws142owV J1kEaWehNLsTyP76PDBqFjLrGEjU8IafGBbCwy2/Ete65GXTH7WLa1lHzhfQAPdFEfD7 cl7mmdnqQVoPbUrAbO5Shdg8GhnGWq2WzsQR6WkwT9T6LHIGjtFDYfoV39cU7xNsuvRp VVQed2INPczoqx+liQswrjNl+LIfT5LIqn3rXTqCNYiKPY+KdmFkQYVDghMqxUJJD0Y+ t/kT97jAPiMwQXazPdrBjAOMew0ptkkiRAUjej5iTnHkGhQAPr/46tnP7aXU8zUgGYqx 77UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=oBShydfWKRxsIjRT6/bc1KcUgJ4UXS4qY8dArj0YbV4=; b=ykiRpduZuUiC+bIk/ny6OP3Pxvh2sL05HhO6rPWbMnWzV0cCsdqU5LjrqMnYFDvYq1 hxtKuFX95aYZFNCZFa0FaYQB5dWVoCsFd6cZYY+rxvFxcwoOlWGYfNTKHlhc2KXK1Lvz tGV92J+FODdpxZneiQDgCaPJYI/7bo8BUICMtS7PTKloVDfr+BtL/R+qJtxwLE5hM0dq TR9oVbmYBXw69d05JgGCbHtn/j51c3k3sI/+l0UkzCzbUnVFjVyKAHd6kWGDTHCX+nGO 1vSaooizXnOaCeDShUECrdiwFmbCsYg81+h9taAONqkbF56eXOEhxJ+7ctB0RjPskOZZ 9PUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YqCvY0N/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 124-v6si5589348pgg.29.2018.05.28.03.06.24; Mon, 28 May 2018 03:06:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YqCvY0N/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932078AbeE1KGQ (ORCPT + 99 others); Mon, 28 May 2018 06:06:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:54086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754481AbeE1KGJ (ORCPT ); Mon, 28 May 2018 06:06:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B72E2089D; Mon, 28 May 2018 10:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527501968; bh=5K8Zx/9TGijNfRROwFJx9PdHuSsN1/RWqGfNEZyR3dg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YqCvY0N/cbiL0+9x9qSdErzqC2+yBOr+EW9nDPmxhS1orvXHC4Z46B1bOIA1b334H zWX1e0mVLcpK/kVMFc8oo7FYp1Ode04VefMY+5lRh1wzenZmhk5CsQtUWX+W6tntel K17AEESdvzLck8p1NLRaj3hAPhq9I0Jp75Su36U4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anna-Maria Gleixner , Christoph Hellwig , John Stultz , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , keescook@chromium.org, Ingo Molnar , Sasha Levin Subject: [PATCH 3.18 013/185] tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account Date: Mon, 28 May 2018 12:00:54 +0200 Message-Id: <20180528100051.432439052@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anna-Maria Gleixner [ Upstream commit 91633eed73a3ac37aaece5c8c1f93a18bae616a9 ] 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 Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- include/trace/events/timer.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h @@ -121,6 +121,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 @@ -147,10 +161,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)) ); /**