Received: by 10.213.65.68 with SMTP id h4csp2133549imn; Sun, 8 Apr 2018 20:33:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/vwI8PHrrT3sSQaEzpgkOHEoOH4N2UCJA3YX4jN6lKMHGLD0LHN+7Q/LT+EUGT2RFc4oRA X-Received: by 10.99.140.87 with SMTP id q23mr23907768pgn.258.1523244786961; Sun, 08 Apr 2018 20:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523244786; cv=none; d=google.com; s=arc-20160816; b=LcU9XkTrFZQsFeTaMtyltcZRB9nq4trN3Gi6Hx71zoDFpwe9XC8UYYR4GMdFnvNlC9 rugwHyf164ZPv/CkRUMK8n4mDkhx4MUwRd61EDeWqPZiEwI/a7oTEeWqEAjYxnJjDgej bt8XgrhJWsbNnU9XA3RM31MikGf+PK8nWFM3NBFzT6xx6sh2d13J5PyI/F9FNGQo93ms Iq7xLnjYEFP10x0dZcf6wK84jfn4drBFo2hZRuSTGSygCHKJ8Gbt3xA7DizCim1oSTsm yXbyj7GQEsufQMiGPlIZoDPtdgMdgifxXRqXWvO4bH9HQ5KSkM1f+V4iEHvjYrJU9qMk 1ntg== 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=TXUnF86lnPKeHX4qpUm/LKZbIe075X3CHPdXVZCyM3USLFs/p3BGa+SYCdY2POJpYd kV1m0acDFGxqkTBsYagsb+J8ffFqzwYgozn4AgdY7bW0JNVtF0QnFB40WYvmec6lfx58 yO7hx25JODVyQhGdyDysMfDNiaNZUwLYhbqILtmEFr0Z4H5NbOQbj09/FuE+vDCGOlRs Yiz63H+hzb7tN2A1omIeVb/eud44Uf4c0qYkfJt5Iqkw/Q9aWZX8RZ8jEtNL0rAE9gO5 fgTw03IBOeXFetiT5bAy1DiI3icpdO8VGKhHJbA7Of2Oao34kNo9nvgeq5DTHTjA31X/ DetQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=myjZ7Dhd; 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 o13si4487753pgs.830.2018.04.08.20.32.29; Sun, 08 Apr 2018 20:33:06 -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=myjZ7Dhd; 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 S1754577AbeDID1u (ORCPT + 99 others); Sun, 8 Apr 2018 23:27:50 -0400 Received: from mail-sn1nam02on0111.outbound.protection.outlook.com ([104.47.36.111]:52845 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754622AbeDIAWH (ORCPT ); Sun, 8 Apr 2018 20:22:07 -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=myjZ7DhdSouWcgsM/3N+SWfZFRn5aadANnYhGmE0bF6T+k52LiEb/0kBhRbVuCXED1OrA9RlRJ+DEoqXY73iZawOk4mMxEaOFTvlvVv8EfjvqrY5eyYRVl+XNKDO2b2kCtu246f0PEJ4n/VAaK4gVIG+aC+I6O3bTTa58uU0bh0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0936.namprd21.prod.outlook.com (52.132.131.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.3; Mon, 9 Apr 2018 00:22:00 +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:22:00 +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.14 011/161] tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account Thread-Topic: [PATCH AUTOSEL for 4.14 011/161] tracing/hrtimer: Fix tracing bugs by taking all clock bases and modes into account Thread-Index: AQHTz5h5A8QiBykPkUSUDtV829T5Pw== Date: Mon, 9 Apr 2018 00:19:49 +0000 Message-ID: <20180409001936.162706-11-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB0936;7:bsM+QWyxbxhEtVCLXUSzDh76Edk2kcBIB/urenW2zmntaYVV4BXH+dI28wKaHFMXsTTnIm3jkIbJCRuL5BDiYB58xuFo836GmOZ7o71HCfC1pP6gYHh/HBrIhJSE3cn8DIasx9IcQiD3CnIzu4zKwa15fm6zl28I9BXkPPB5NEs8gQ8LE6EKTlNU3R9+msvk59m16Kb0LwJ+XXH7U4BiCsH5nO2QBujJ4klcLQ4CxcnDQNL5W7jtD8k8DwwyZkw1;20:1sVmxcefBeLY22x74cOPi+7xsruGsVJj7K+aDaPEnr8V/VkvNV5+99/Jy7MJ3Q2F7I8aUm2Sz+nBpDqdtfP/Ma0da3KSnR/GeObuhytw6jAaY0LIzyuOG0wDOGtRspKgpMIqOkVn1QdAW4CZaY8I0iqOdAIjsk5giC3oNgyJbzk= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: d5ac15bd-ceb8-48d0-3c07-08d59dafe937 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0936; x-ms-traffictypediagnostic: DM5PR2101MB0936: 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)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0936;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0936; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(39860400002)(396003)(376002)(366004)(199004)(189003)(3660700001)(36756003)(2501003)(76176011)(10290500003)(2616005)(5250100002)(3280700002)(478600001)(1076002)(72206003)(6436002)(53936002)(486006)(6306002)(476003)(4326008)(6486002)(107886003)(5660300001)(54906003)(2420400007)(110136005)(102836004)(2906002)(10710500007)(6116002)(15650500001)(3846002)(86612001)(81156014)(81166006)(6666003)(8936002)(7416002)(305945005)(8676002)(2900100001)(6506007)(68736007)(14454004)(106356001)(105586002)(25786009)(966005)(6512007)(86362001)(99286004)(446003)(59450400001)(10090500001)(11346002)(316002)(26005)(7736002)(66066001)(186003)(22452003)(97736004)(7110500001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0936;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: SAtLMluhfVvDt+jrg52H93GZcln3qbmuWK/QySxvaluzEdr3qQ0k8cBu5TEdLckugSNpj7+ecLggqUQZQButl4Ubsc6TdpOxNfYT4mGD1W7Z1JN/NFflRu8f56hLTl2p3QpTDCRk5mqz0smANXp/42IaAL9KIIpDGCs+cdn8fgpsudU0tGD3WQ+TQI+n6HIbKapDPtmdCG/aFGkPFuf+nExxLswt6bKKUDqgrLiqLMVRrnn/nquKMFvTlJgcPkK8XucpaOKD7iV1sGud+ak94YrVyQzPB52DWIt8S71crvnq4hruGmoPB+OGOFAJ4OUVDoks3ydBK19QJWbU4y9qXAbuo7ARcP9n5p7n9+3x7siYVexv3FuvSD0NFgJwexIbDoFNjyuxqcEMERTeL23bL+So2L7qZwgfv0769Hbu4WI= 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: d5ac15bd-ceb8-48d0-3c07-08d59dafe937 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:19:49.9576 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0936 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