From patchwork Wed Aug 29 12:17:07 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: 10580183 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 7FCF3175A for ; Wed, 29 Aug 2018 12:39:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E6222AFF8 for ; Wed, 29 Aug 2018 12:39:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60F432B002; Wed, 29 Aug 2018 12:39:49 +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 05CAA2AFF8 for ; Wed, 29 Aug 2018 12:39:49 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 86DF7D32; Wed, 29 Aug 2018 12:36:43 +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 EC734CD4 for ; Wed, 29 Aug 2018 12:36:39 +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 6ABEC7C5 for ; Wed, 29 Aug 2018 12:36:36 +0000 (UTC) Received: from mr04.melco.co.jp (mr04 [133.141.98.166]) by mx04.melco.co.jp (Postfix) with ESMTP id 600213A28E0 for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) Received: from mr04.melco.co.jp (unknown [127.0.0.1]) by mr04.imss (Postfix) with ESMTP id 420l4T2jFRzRkF8 for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) Received: from mf03_second.melco.co.jp (unknown [192.168.20.183]) by mr04.melco.co.jp (Postfix) with ESMTP id 420l4T2PTqzRjwX for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) Received: from mf03.melco.co.jp (unknown [133.141.98.183]) by mf03_second.melco.co.jp (Postfix) with ESMTP id 420l4T1wCGzRk8v for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) Received: from JPN01-OS2-obe.outbound.protection.outlook.com (unknown [23.103.139.144]) by mf03.melco.co.jp (Postfix) with ESMTP id 420l4T1WQlzRk38 for ; Wed, 29 Aug 2018 21:17:29 +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=jHDG38cF0yLnFRqAsGns73mubBLz9N/uXUeIpH7IX54=; b=VSE2t6M1KK6RIp/cpl+cOTCD5lCuPCCbnjayNA23CHGmeNg/GeqPtEmw1aKbfRjo8bRa60SFh/eJpbzADDMa3CSTXc1fyKJfg5PP60N4aYqKHM2fOMc6nZr5d3Hvyhc+3hebqMKvyBtdficzc1QdMUrFlWo56deUUX97NV1Jc1c= Received: from TY1PR01MB1692.jpnprd01.prod.outlook.com (52.133.160.145) by TY1PR01MB1708.jpnprd01.prod.outlook.com (52.133.160.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:17:28 +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:17:28 +0000 From: "Motai.Hirotaka@aj.MitsubishiElectric.co.jp" To: "ltsi-dev@lists.linuxfoundation.org" Thread-Topic: [LTSI-dev] [PATCH 21/54] tracing: Account for variables in named trigger compatibility Thread-Index: AdQ/i5KqNuuv7v7oR6q8U/9ZGgQi8A== Date: Wed, 29 Aug 2018 12:17:07 +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; TY1PR01MB1708; 6:yLg3XeKU56z3Q6iPR4xgavL3UXcI6rIMUSk1ZkO+/rZ0gdT2px5BUDefSd3JlTZotPQxZ31OnepVbqkrS+SZvVvFUWEcmtodMFRGqoEVn1ViB1T76rgSnB/z13C2uIUIOPQgGxBCwrPkamebJtgcob62gjQ21dqsbTSO9gxQO/v03LOZQwrtiL6AzGyZOrcl85EQUEHrWTNyHmJVjYyzxHD7ej+CkdumodcX5DmZx2nqYpRr0ny60FxgzaFwWQSuJUp+F3WqtYSDMwolhwMxScHheMpxN7ZIHzBI2lSTm7NntXgOxhKVl03kbSY78gAxP4HiXJwyT8pFK+ElJP7ohrB+vDCLmZ9Lhe00sE1P0kJ4qK+KvyQs5K6RVY1lQyO3kiajdSNkIZVI2wmJeNMa+AWgdIzvfLGqVCDiRmXGPAOZvIorJr0qfOc92BxqCpwXuaMdbaugzoaCU6mpsOO8cw==; 5:U/GA85SzdJSylLqIhR48IxsygOtwvfdIGFvo61W8u9rdSdsf6fGMYDmzw3jAwfE6zG9YFUY6PBd5vh3Zx+yrSqpP0xWiZuvQU0/D3sswvTIDhaZq9u6bRgTSUZc4pue6EOyVAVpagmbmNt72mZhA9x72pzY6+OsotkBy8/pwzPg=; 7:Ug4K30aPYogojgencXJIud9mL7bbfgA9VGe61qNuM9K76x5j+RRHNkApeJMImShMQog/FW/ZTHM8IYfNlz/GkgqElZki3crZcknx7tGus6Vu6OonzXesDmuixM1qe5lyxaGZBJHPJEJyd6c0W0Kai/H0zgar/73ldxG6NU3Ok6DDln1AkJHI1IHacFUQ0VtDFXEXI0wxn+A8aqqp0HYrK5yyvh2eaSOqXp9OajU44y4EiXuTLn3RX0MFfDQNZzPC x-ms-office365-filtering-correlation-id: a2cb9b6a-cfaf-43c6-9616-08d60da96350 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:TY1PR01MB1708; x-ms-traffictypediagnostic: TY1PR01MB1708: 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)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699016); SRVR:TY1PR01MB1708; BCL:0; PCL:0; RULEID:; SRVR:TY1PR01MB1708; x-forefront-prvs: 077929D941 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(366004)(396003)(39860400002)(346002)(376002)(189003)(199004)(966005)(25786009)(74482002)(7110500001)(81156014)(2420400007)(8676002)(106356001)(5660300001)(105586002)(6506007)(14454004)(15650500001)(81166006)(33656002)(26005)(7736002)(74316002)(186003)(72206003)(305945005)(66066001)(68736007)(97736004)(478600001)(476003)(102836004)(2906002)(10710500007)(8936002)(6666003)(6916009)(486006)(6116002)(1857600001)(316002)(7696005)(2900100001)(5640700003)(3846002)(55016002)(99286004)(53936002)(14444005)(86362001)(256004)(6436002)(6306002)(2501003)(5250100002)(9686003)(575784001)(2351001)(309714004); DIR:OUT; SFP:1102; SCL:1; SRVR:TY1PR01MB1708; H:TY1PR01MB1692.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:0; received-spf: None (protection.outlook.com: aj.MitsubishiElectric.co.jp does not designate permitted sender hosts) x-microsoft-antispam-message-info: tZOAWA8dJ/quMrPEiQoSZD0LcP6TltKVtqAo+FYQ6lzBsYHVzlICkajlOKu045EvvIxz7NUCnSmWk/fpxkITUsnH8Bz0wHVG84IV2aEIkpC5ldsHciXW0T6j09L/KSjHnSWedPFOieKM7gPvCi0mGWhQH5sCo/GEHu4paq1Ni1lh9gjGzgyFQdkHFUsedAoy+D/ZuFVhYA6AFolqMHX3nUGlCQt/Nz1HFBvDzVIvzxIsLxxF6GWd1NYAuF7HuycigyYiGckzTMwxEr8s4ylPW5DE2JsMzb973Trea1uLkjGX4XPbkoyeMO/j+j5F/Z3rxZP0/LIv4BD99jHC9Xckg7aEUMW0M7TQe2yCrj2bI2w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aj.MitsubishiElectric.co.jp X-MS-Exchange-CrossTenant-Network-Message-Id: a2cb9b6a-cfaf-43c6-9616-08d60da96350 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2018 12:17:22.6347 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c5a75b62-4bff-4c96-a720-6621ce9978e5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR01MB1708 Subject: [LTSI-dev] [PATCH 21/54] tracing: Account for variables in named trigger compatibility 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 Named triggers must also have the same set of variables in order to be considered compatible - update the trigger match test to account for that. The reason for this requirement is that named triggers with variables are meant to allow one or more events to set the same variable. Link: http://lkml.kernel.org/r/a17eae6328a99917f9d5c66129c9fcd355279ee9.1516069914.git.tom.zanussi@linux.intel.com Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 1a361dfcf261d68f081a12133aa8d0d6d6cca34f) Signed-off-by: Hirotaka MOTAI --- kernel/trace/trace_events_hist.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 8f43f24b..ba326260 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1605,17 +1605,17 @@ static int event_hist_trigger_print(struct seq_file *m, unsigned int idx, first_key_idx; /* skip VAR vals */ first_key_idx = hist_data->n_vals - hist_data->n_vars; sort_key = &hist_data->sort_keys[i]; idx = sort_key->field_idx; - if (WARN_ON(idx >= TRACING_MAP_FIELDS_MAX)) + if (WARN_ON(idx >= HIST_FIELDS_MAX)) return -EINVAL; if (i > 0) seq_puts(m, ","); if (idx == HITCOUNT_IDX) seq_puts(m, "hitcount"); else { @@ -1793,16 +1793,21 @@ static bool hist_trigger_match(struct event_trigger_data *data, if (!compatible_field(key_field->field, key_field_test->field)) return false; if (key_field->offset != key_field_test->offset) return false; if (key_field->size != key_field_test->size) return false; if (key_field->is_signed != key_field_test->is_signed) return false; + if (!!key_field->var.name != !!key_field_test->var.name) + return false; + if (key_field->var.name && + strcmp(key_field->var.name, key_field_test->var.name) != 0) + return false; } for (i = 0; i < hist_data->n_sort_keys; i++) { sort_key = &hist_data->sort_keys[i]; sort_key_test = &hist_data_test->sort_keys[i]; if (sort_key->field_idx != sort_key_test->field_idx || sort_key->descending != sort_key_test->descending)