Received: by 10.213.65.68 with SMTP id h4csp2160612imn; Sun, 8 Apr 2018 21:17:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx49QWeXNrz+g8XUs7E23U+iR22TLG/YsF7aMMDvEMKmimXp66/EzTYh8vSQzeTzLU/DvFSGK X-Received: by 2002:a17:902:5a5:: with SMTP id f34-v6mr37426263plf.288.1523247451441; Sun, 08 Apr 2018 21:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523247451; cv=none; d=google.com; s=arc-20160816; b=aXV81q5Ejp4a6XXGfQ+DyE1qzV6B+E9g3Rx/2IBSAktoo0NPEnBYbWSh5cSaLrXOYW C13w+Unq45iLaWwoN/5mQCZ2ToOrLz1uW9/xj+NbPDJ6Y6k7QgIGYjKrsqjqmezOmEqt JOS5tEeqRs7V5fj00ZeXgxP8TQs8dVt78Qc4S/8cJyQdg2UaBjhCAusJ1HuLYdRjO3ZV di0RacKbDpBwB5IiH50zjZrZvFMe7RA/0cvuZvwEtv9VZQugMNdGO0YN7tJdioDYe2Fs RCTvpCbgiX6oAilXZbcJqm7xY+gwqcUTbM6Md/Bv0GAK2Uhy5EKFAyVtKMGqXM79P77O J9fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=M3yjupSaiON2g6Pk1Y3fvo4OgI4bKco6cfYk6tJA8p8=; b=lNpAnqcpzSK8CaZ1oJCTck4FBCuDOO9X39NVdon5F23NIwzGAnO4dmkv7Bm57ht2zW ujYjqFvSCWCwkbwtAW29BDpXM/nqJWUpne7DgfUDlMSa72fGE5Fri1py66JbXg02Y2o4 sc10XtH5GN9DARUeiPTtKIClz69IWknzxrItfVlWXihIycCAcwcVYCAesQVTLQeoziLT mW3fWM6Wqv15Xc8IV3lwk0qMOlZ37hfpq0BtrL4N5S9PJcN9OG7jtu3NjhslX5Lp1kwv D9ghJ0BoAR4KtbWS96rTd5Rlb/OXrz2UnnhzrX9YZt6lylQ4AS7bgXvH2/CHX66BGdig ADaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=GgSGRVrh; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i81si12278588pfd.261.2018.04.08.21.16.54; Sun, 08 Apr 2018 21:17:31 -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=@microsoft.com header.s=selector1 header.b=GgSGRVrh; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754490AbeDIEMB (ORCPT + 99 others); Mon, 9 Apr 2018 00:12:01 -0400 Received: from mail-co1nam03on0101.outbound.protection.outlook.com ([104.47.40.101]:48974 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752978AbeDIARA (ORCPT ); Sun, 8 Apr 2018 20:17:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=M3yjupSaiON2g6Pk1Y3fvo4OgI4bKco6cfYk6tJA8p8=; b=GgSGRVrh2mA2NGUnCzQiAMcAKc8blggOX7YpJ3FHwe389mStWEUyCQCJK753HpuJn9fVn4cschHPLwbSzTZHVXmydoFSkyR7hiw6UROsFEX8Mi0E2AXP1+J2eG9M+k/utixBbbdlxcgNsxvZ2CGFYdJ1VIkVZ1Bs9rsCJA3hkxg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1127.namprd21.prod.outlook.com (52.132.132.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:16:55 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:16:55 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Anna-Maria Gleixner , Christoph Hellwig , John Stultz , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , "keescook@chromium.org" , Ingo Molnar , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 014/189] tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account Thread-Topic: [PATCH AUTOSEL for 4.15 014/189] tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account Thread-Index: AQHTz5gRAGd5HPN2fkyehcUcps9GSw== Date: Mon, 9 Apr 2018 00:16:55 +0000 Message-ID: <20180409001637.162453-14-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1127;7:lghP1cWr16Jab8cV4nuywLOVJvd3uqoVE91GoWyyR/XwXV4VxsRbjFpcfgP/0QD5gBM1t4taClM5N9Gpt+GHB2/Mdtbji8qSpEWw78932VYRHAZAvNQNXXb12qHFkgN6JMB4V4bnt0L6no7P8A8MbKyan7WFc2AnZgn3qmMsypx0olKoWvgLAQFnfpD5MBKR7xERTQuyHljO+LujBwQtVn31F1BPlTmez+9oiefxgI/PA0+mk09XO9226gPE6VPo;20:nLinXipG6eLjKfVnPLUHjDWdD2I0FM9bX/CnsGsVjMqd5G+uaXn0STAqJLOzRpPL2hpYzfsFzqst65R0B0Mi2z2SWSOjHfgVTsXiWxcCwMfTArfmJUdVrllA0o7jRWrEFtmprQgpmuybFDiSBBNw5Os2rhwNjaEE3DzNzTue3X0= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 020d59b9-2e6c-410d-8803-08d59daf33b2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1127; x-ms-traffictypediagnostic: DM5PR2101MB1127: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(42068640409301); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1127;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1127; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39380400002)(39860400002)(376002)(346002)(366004)(189003)(199004)(15650500001)(105586002)(186003)(7416002)(66066001)(6486002)(54906003)(7736002)(26005)(86362001)(316002)(305945005)(110136005)(478600001)(3280700002)(86612001)(2420400007)(10290500003)(25786009)(5250100002)(2616005)(99286004)(22452003)(5660300001)(966005)(3660700001)(2900100001)(81166006)(3846002)(2906002)(106356001)(6506007)(59450400001)(107886003)(486006)(8676002)(7110500001)(81156014)(14454004)(10090500001)(68736007)(10710500007)(4326008)(6116002)(1076002)(72206003)(102836004)(6306002)(97736004)(11346002)(8936002)(476003)(2501003)(6436002)(6512007)(446003)(76176011)(36756003)(53936002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1127;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: UCRQmAIPj+i95DCq+JSyWvJ+ripU3W1OVWLLL7HjOguY6W+XZcRY8er5ayrvwooTt2K8WD5Wk86SAAf/bPI8FYCK+f50CSzy7kkPmXGCjnYVfRaE1YXDgirQ7081p8ULcULfw8Yvt3BWw0cDZF8bJHhd9blrYatl9I8/lNisuioZuF6nVBsDf5402WC+PBtMG5+i2Np+Gl0/XLrNWDN7B8srP13EWgUB5bvaFRn24My5M383cOIbfP+4YXbcPBaI5MQiMXSEsjs9GVo5UfBJRBBBlqGqgX9655iNuIBLe4DbAucvci9+Sg8uo6yjzJ1VNcgTCnmRQWNkAHVmtbT5NEDd1Dby1rPM6lUz8Cep9i1dZy3n/jCgTjYgp9u44FMNJyPSmhJT0Vc35yOpO4bAkUilQtL6uHgcXj6D5ZR+CTk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 020d59b9-2e6c-410d-8803-08d59daf33b2 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:16:55.3719 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1127 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 th= e 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 --- 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 16e305e69f34..c6f728037c53 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) ); =20 +#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, ), =20 TP_printk("hrtimer=3D%p clockid=3D%s mode=3D%s", __entry->hrtimer, - __entry->clockid =3D=3D CLOCK_REALTIME ? - "CLOCK_REALTIME" : "CLOCK_MONOTONIC", - __entry->mode =3D=3D HRTIMER_MODE_ABS ? - "HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL") + decode_clockid(__entry->clockid), + decode_hrtimer_mode(__entry->mode)) ); =20 /** --=20 2.15.1