From patchwork Wed Aug 29 12:17:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Motai.Hirotaka@aj.MitsubishiElectric.co.jp" X-Patchwork-Id: 10580207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 688D2175A for ; Wed, 29 Aug 2018 12:41:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53FB92B00B for ; Wed, 29 Aug 2018 12:41:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 469B22B012; Wed, 29 Aug 2018 12:41:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CFEF42B00B for ; Wed, 29 Aug 2018 12:41:23 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D7DB1D38; Wed, 29 Aug 2018 12:36:47 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id BAD44D2A for ; Wed, 29 Aug 2018 12:36:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx04.melco.co.jp (mx04.melco.co.jp [192.218.140.144]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 80231619 for ; Wed, 29 Aug 2018 12:36:38 +0000 (UTC) Received: from mr04.melco.co.jp (mr04 [133.141.98.166]) by mx04.melco.co.jp (Postfix) with ESMTP id C64A23A32BA for ; Wed, 29 Aug 2018 21:18:08 +0900 (JST) Received: from mr04.melco.co.jp (unknown [127.0.0.1]) by mr04.imss (Postfix) with ESMTP id 420l5D5PplzRk8j for ; Wed, 29 Aug 2018 21:18:08 +0900 (JST) Received: from mf03_second.melco.co.jp (unknown [192.168.20.183]) by mr04.melco.co.jp (Postfix) with ESMTP id 420l5D560szRjwX for ; Wed, 29 Aug 2018 21:18:08 +0900 (JST) Received: from mf03.melco.co.jp (unknown [133.141.98.183]) by mf03_second.melco.co.jp (Postfix) with ESMTP id 420l5D4bY3zRk8v for ; Wed, 29 Aug 2018 21:18:08 +0900 (JST) Received: from JPN01-TY1-obe.outbound.protection.outlook.com (unknown [23.103.139.179]) by mf03.melco.co.jp (Postfix) with ESMTP id 420l5D4P6pzRk38 for ; Wed, 29 Aug 2018 21:18:08 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mitsubishielectricgroup.onmicrosoft.com; s=selector1-mitsubishielectricgroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lb7I/3vZvX8tVtoxEIwSyDkzf6RpEe/zxwz16RX8Bfk=; b=e7PI9lPYo6Tqk6ijQQtTCPypW3SgmNVDpYv7xDKH0v4G53NfeMKkflGpxAjtWKn1rmhPYzCCBs60YKNrqTjS2BxogB1bxCL9X9N+HdBBTXwYch2CKfDowkp7Jjdw7UsIHaVUr2z+c0rQx6QPinK1wGxZ9d/QToAcwDPH9br3eAY= Received: from TY1PR01MB1692.jpnprd01.prod.outlook.com (52.133.160.145) by TY1PR01MB0762.jpnprd01.prod.outlook.com (10.167.158.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Wed, 29 Aug 2018 12:18:08 +0000 Received: from TY1PR01MB1692.jpnprd01.prod.outlook.com ([fe80::d04e:e6f6:c782:22fa]) by TY1PR01MB1692.jpnprd01.prod.outlook.com ([fe80::d04e:e6f6:c782:22fa%2]) with mapi id 15.20.1080.015; Wed, 29 Aug 2018 12:18:08 +0000 From: "Motai.Hirotaka@aj.MitsubishiElectric.co.jp" To: "ltsi-dev@lists.linuxfoundation.org" Thread-Topic: [LTSI-dev] [PATCH 44/54] tracing: Fix display of hist trigger expressions containing timestamps Thread-Index: AdQ/jPAnVYy+7JPjRTOtoAMfVIc2hw== Date: Wed, 29 Aug 2018 12:17:11 +0000 Deferred-Delivery: Wed, 29 Aug 2018 12:15:00 +0000 Message-ID: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-melpop: 1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=Motai.Hirotaka@aj.MitsubishiElectric.co.jp; x-originating-ip: [153.231.200.201] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TY1PR01MB0762; 6:0uxKKB3ujKdQsbESHC8Uw3hdZEbAmZE98PSBRo+G1b5WZdB5swKO6aegl0/4T8mHHAxFmZHt7uLW1Dq6xhLZM5hvMm8FYLBwq/B3epoghEEBpM7JrSIP6oFGbTFFiT1CZYIoIM1ORikZPtQD8/jfC/GQ/Kluyr7ZF2NEYWk2sUGddsqUCcVvnofX7f5OUb6w6yUG5A0/pjBP+Lf6rwGj16UdbyCvQaR2peIzFILID003BCbcVSUpbEanc0HBjg3TCY9a4W3MZY+f4IUrAuboIuGyDnxXnt5srL13DxXm2VcmRxJulStxLHmsUcs7+LnlwxyXwv037PpJsjTg5QycFx+oLiwODO6CkkXDahOhDAZZn675qGPFOHfyEhvOrWruU/YklFgW9VUovXIcihyapL8AU5OWxkYZHJ7t4DmJhVLr9mDXcSRMgPO3/0M1PE2JmtSPZ8WbvHx3SCpGzy7CpA==; 5:9MuX2yv5j16BO5TjbqSYTEVUaN/1XJWNLVZFAPFsYn3+OgYl4Xx4SNxkENxdpvrlfpq/YY0HgNFd9JDDipbeLbvSnFmWwQ4GFtNEzbeTZbytN+1X0N8PX3EFPp9tROE5ZB4rDiZfibpisQTx7vBshjKFcH+n3hoRwfKt+bBdr0A=; 7:mllxbLXhKmGOVcryaDxye7ED4228ZzfA3T0we+JkUypB7c0/vBNLx9lVL6OwELDFf9bF09FpeROQTC/GCIMUTfaxvKOH9S5dA3grHCKoTOSI7+UMcAZa5L9Fo40TW6NAQfvjrJwPxitkE+r9BbtOQHc59VHfXKcaH2IT+xoDVRF3w5sy3xZ2iSDmEwMvN0sXVklca+KkLrl1tz8qYEju42c+HNiuuSJb5DWCUu9aBTYhVzrB8r/Oj0+XFrYOYTMt x-ms-office365-filtering-correlation-id: 79421f1c-2002-4935-c9e4-08d60da97ad6 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:TY1PR01MB0762; x-ms-traffictypediagnostic: TY1PR01MB0762: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(42068640409301)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201708071742011)(7699016); SRVR:TY1PR01MB0762; BCL:0; PCL:0; RULEID:; SRVR:TY1PR01MB0762; x-forefront-prvs: 077929D941 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(396003)(346002)(376002)(136003)(366004)(199004)(189003)(7696005)(186003)(72206003)(6116002)(478600001)(3846002)(1857600001)(256004)(74482002)(5250100002)(5660300001)(966005)(2501003)(99286004)(2900100001)(8936002)(53936002)(68736007)(33656002)(9686003)(2906002)(97736004)(6306002)(26005)(476003)(7736002)(305945005)(74316002)(6666003)(316002)(14454004)(486006)(55016002)(81166006)(5640700003)(66066001)(8676002)(86362001)(6436002)(2351001)(6506007)(106356001)(25786009)(6916009)(105586002)(102836004)(81156014); DIR:OUT; SFP:1102; SCL:1; SRVR:TY1PR01MB0762; H:TY1PR01MB1692.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:0; MX:1; received-spf: None (protection.outlook.com: aj.MitsubishiElectric.co.jp does not designate permitted sender hosts) x-microsoft-antispam-message-info: y82EY5SqULF6L8zAaOE486PM5EXhpmoTNbTTSBEkyWI9UZBJedXE6QGOPbFtXukClSdZH8HquN3jkB7g7c8uaUAlAXgfXwn/ce3LQxViFbbCX1IOMlL8qx9Ek7sTXOCi3Phcpr99CwDMA5XyVxWFAdtz88tJQWh6UyiS/FrTGb9f+qV3+maQRb1INxiodWL9S3jN2Hc1k0/FnU452BMxJuka1PwjbG8FvXl68nLTeEKm6DMWgN+yhUI8U73ZIWuPKbz95/um1jfpOgK34L2g68fQW9e7lv9asCTZGQ31e+q0lNymGhrvwnS2PFFXBNRKz+7WWCtIo/kxaeNGq8voova/uQ/xL3VonzIsefjMaps= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aj.MitsubishiElectric.co.jp X-MS-Exchange-CrossTenant-Network-Message-Id: 79421f1c-2002-4935-c9e4-08d60da97ad6 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2018 12:17:22.6477 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c5a75b62-4bff-4c96-a720-6621ce9978e5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR01MB0762 Subject: [LTSI-dev] [PATCH 44/54] tracing: Fix display of hist trigger expressions containing timestamps X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP When displaying hist triggers, variable references that have the timestamp field flag set are erroneously displayed as common_timestamp rather than the variable reference. Additionally, timestamp expressions are displayed in the same way. Fix this by forcing the timestamp flag handling to follow variable reference and expression handling. Before: # cat /sys/kernel/debug/tracing/events/sched/sched_switch/trigger hist:keys=next_pid:vals=hitcount:wakeup_lat=common_timestamp.usecs:... After: # cat /sys/kernel/debug/tracing/events/sched/sched_switch/trigger hist:keys=next_pid:vals=hitcount:wakeup_lat=common_timestamp.usecs-$ts0.usecs:... Link: http://lkml.kernel.org/r/92746b06be67499c2a6217bd55395b350ad18fad.1522256721.git.tom.zanussi@linux.intel.com Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 0ae7961e75c3fe3383796323d5342cbda8f82536) Signed-off-by: Hirotaka MOTAI --- kernel/trace/trace_events_hist.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index a02bc09d..4f4792f4 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1681,34 +1681,33 @@ static const char *hist_field_name(struct hist_field *field, if (level > 1) return field_name; if (field->field) field_name = field->field->name; else if (field->flags & HIST_FIELD_FL_LOG2 || field->flags & HIST_FIELD_FL_ALIAS) field_name = hist_field_name(field->operands[0], ++level); - else if (field->flags & HIST_FIELD_FL_TIMESTAMP) - field_name = "common_timestamp"; else if (field->flags & HIST_FIELD_FL_CPU) field_name = "cpu"; else if (field->flags & HIST_FIELD_FL_EXPR || field->flags & HIST_FIELD_FL_VAR_REF) { if (field->system) { static char full_name[MAX_FILTER_STR_VAL]; strcat(full_name, field->system); strcat(full_name, "."); strcat(full_name, field->event_name); strcat(full_name, "."); strcat(full_name, field->name); field_name = full_name; } else field_name = field->name; - } + } else if (field->flags & HIST_FIELD_FL_TIMESTAMP) + field_name = "common_timestamp"; if (field_name == NULL) field_name = ""; return field_name; } static hist_field_fn_t select_value_fn(int field_size, int field_is_signed) @@ -4853,33 +4852,25 @@ const struct file_operations event_hist_fops = { static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) { const char *field_name = hist_field_name(hist_field, 0); if (hist_field->var.name) seq_printf(m, "%s=", hist_field->var.name); - if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) - seq_puts(m, "common_timestamp"); - else if (hist_field->flags & HIST_FIELD_FL_CPU) + if (hist_field->flags & HIST_FIELD_FL_CPU) seq_puts(m, "cpu"); else if (field_name) { if (hist_field->flags & HIST_FIELD_FL_VAR_REF || hist_field->flags & HIST_FIELD_FL_ALIAS) seq_putc(m, '$'); seq_printf(m, "%s", field_name); - } - - if (hist_field->flags) { - const char *flags_str = get_hist_field_flags(hist_field); - - if (flags_str) - seq_printf(m, ".%s", flags_str); - } + } else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) + seq_puts(m, "common_timestamp"); } static int event_hist_trigger_print(struct seq_file *m, struct event_trigger_ops *ops, struct event_trigger_data *data) { struct hist_trigger_data *hist_data = data->private_data; struct hist_field *field;