Received: by 10.213.65.68 with SMTP id h4csp1872525imn; Mon, 19 Mar 2018 15:56:44 -0700 (PDT) X-Google-Smtp-Source: AG47ELscXZp44PK17mykyHMaNy3ziVPKUebFtX4fkBzQHU3QI4pwvzJNhUD6KEPvwLifXeelhMU6 X-Received: by 10.98.207.135 with SMTP id b129mr11607559pfg.84.1521500204622; Mon, 19 Mar 2018 15:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521500204; cv=none; d=google.com; s=arc-20160816; b=xxEEV1+clXKknzTwoJYX7gIK08BIjYnNCTFVfjLSw12vtZxiBU+eohXBqViAjauQTW 4R2ypwHgi6siDq4TttFjP1YRjSGutwOzKiJgB/Wlf39R/X+vxu4+CdXIs9cWEReRdiqL rGSdhN8sQw5lDl0vauOkVwLtX67OpOhrC91r1/OcJalzy/qMyixNKmKgwCGZHcBXDu6W 9yZoIwGriRaKKsdQpevP43QGMCWW232SMRliwNrfgpfOlHivNBnC6JHFI55Tu38Pmmdd KFt2OuaUp15RfvYCM4BPrOv31ThtEE8+8zuVeX7Z9c2SlqISnXkvrYJk89WS1ttubHb4 m11g== 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=Si2o/S3JQUvrpH0l+eE5lhWX+odWalqCs2gcGWQ2LQ4=; b=hjBcH9TNSXrLEZO3inDMO2PJAMYd0tTwTaa9vTih4CjrK1GTq4vsb07Oq5Qidh2WtQ FgT0qQtut9cvkQywcgwI86UirwPz1JUULAI+FFe3dy+nFx2BOuCAo45xSe6qTRDXTF3o 78pZvKal/7bCbTIgyNzq2ggjJLj7Im4jL6Fvl7uErNs5YQHgbXNNKULERMIeyFxa/c+Q DGQnRYQCoZrUrWOhIV7B/1VETKd8c6jZcuQNhV/WhMcWr0we7Cc/4YOf9g6BE48+xwxH C6JZ6NMXn8ilq/aSaW7tpgK1zLhwa5p9k9nWb380SniOfEb+xORKDCqV/y2rt05ZZAXG PysA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=DG5j8n9T; 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 c7si153467pgq.734.2018.03.19.15.56.30; Mon, 19 Mar 2018 15:56:44 -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=DG5j8n9T; 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 S933436AbeCSPrc (ORCPT + 99 others); Mon, 19 Mar 2018 11:47:32 -0400 Received: from mail-by2nam01on0103.outbound.protection.outlook.com ([104.47.34.103]:19764 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755983AbeCSPrO (ORCPT ); Mon, 19 Mar 2018 11:47:14 -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=Si2o/S3JQUvrpH0l+eE5lhWX+odWalqCs2gcGWQ2LQ4=; b=DG5j8n9T8EB59gIf7bkzuD10AN1tQlsGbyoQPTNygdSt4B21gL5yQ1VLh3xlq9f+h0JpUQnRiGcG+8JPIpVQBnZVjWjlJCoE39qrjVc04aKUnm2UFYAdN0rSgcHt0XA0lq4Jl8MaJaVwaqJGSrOJsfv+zTeVC4kLR8B72vVkIus= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1013.namprd21.prod.outlook.com (52.132.133.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:47:07 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:47:07 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Masami Hiramatsu , Paul Clarke , bhargavb , "linux-rt-users@vger.kernel.org" , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 010/124] perf probe: Add warning message if there is unexpected event name Thread-Topic: [PATCH AUTOSEL for 4.15 010/124] perf probe: Add warning message if there is unexpected event name Thread-Index: AQHTv5mJV8tAJLxFik29hOo2ee65HA== Date: Mon, 19 Mar 2018 15:47:07 +0000 Message-ID: <20180319154645.11350-10-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-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;DM5PR2101MB1013;7:/db8UfUMYi3C33D3j9CK/Wc1L2xNniHwmBCwtN7lZX+rm7P5mikY5fSMt8O075oMNzF5xLPaoPSO8KgkijwsjjAia29dlj77pm/6PtUBsSL+Aemai3dIE8XS30YPGdD++1gWvOtX2arJ3cdHFShMm+AHnNR4UYdib3+5+krlu/8q6w5GvMLLQZG6zw87stuqz2Fzd1kz5YClFl/64Sc+Nqi/QbUboiraDei26/pv3MdXfTQ8HFmxzX37CqxvzYgi;20:lSBPErny6+BSjBa/xLwj5Rg+whffkYfPyvjUScFFYjIxq2NEzwQwOiLlvvHDc+eCVV3tyAzx8PDDhU0Gt6rZQbqlUBesunKp4EdQYZx0fpCqC16Wv8TwRUz+QuCr/SBCvi/oufRulCXJbQpFI4SqDUucHarA1vzOiqLSSQZkPLg= x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c73b2ebc-8c5d-404e-214f-08d58db0abc8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1013; x-ms-traffictypediagnostic: DM5PR2101MB1013: 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)(9452136761055)(85827821059158)(42068640409301)(274839183919467)(104084551191319); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1013;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1013; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(346002)(376002)(39380400002)(189003)(199004)(86612001)(316002)(26005)(72206003)(4326008)(25786009)(110136005)(10290500003)(966005)(86362001)(575784001)(59450400001)(54906003)(53936002)(36756003)(107886003)(3280700002)(39060400002)(14454004)(22452003)(8656006)(6506007)(5660300001)(68736007)(99286004)(186003)(478600001)(76176011)(2950100002)(10090500001)(102836004)(7110500001)(6116002)(5250100002)(2501003)(97736004)(3660700001)(106356001)(81156014)(81166006)(8676002)(8936002)(2420400007)(15650500001)(7736002)(305945005)(2900100001)(105586002)(3846002)(1076002)(66066001)(6436002)(2906002)(6306002)(6512007)(10710500007)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1013;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: 47eBB4Iv64kiN0IsmP8VufdinknkQ8f55xrHiDB8dq0E0COjj1tQdPjcEpTZWn1OoEn4Xa2HUWwaLIh8jSu19VsBm7SfNOqHYjqJlINr+9fhDe2tfKmvDAjF4E3Jc8/ZdSMARrbYDrcVkgwpA7QRjF4VjD4b8UIJVI/Typte6aBJ/rgYymGeVC5P7WQvwmC7JL4jHjp7kWLcQ9v6x++KipIIBkkwjzgUuIl7PP6C8xVQHQHmXi7wg9+Bz9tXEh+gSUq2aaUhhj5gxqXNuotnEqj694hOgSHRlEr8i9e4NkaxqICPnf3szLESl7w7EpjLv6zfL7Sh3kQ90SyMGQoTfw== 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: c73b2ebc-8c5d-404e-214f-08d58db0abc8 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:47:07.7022 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1013 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masami Hiramatsu [ Upstream commit 9f5c6d8777a2d962b0eeacb2a16f37da6bea545b ] This improve the error message so that user can know event-name error before writing new events to kprobe-events interface. E.g. =3D=3D=3D=3D=3D=3D #./perf probe -x /lib64/libc-2.25.so malloc_get_state* Internal error: "malloc_get_state@GLIBC_2" is an invalid event name. Error: Failed to add events. =3D=3D=3D=3D=3D=3D Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Masami Hiramatsu Acked-by: Ravi Bangoria Reviewed-by: Thomas Richter Tested-by: Arnaldo Carvalho de Melo Cc: Paul Clarke Cc: bhargavb Cc: linux-rt-users@vger.kernel.org Link: http://lkml.kernel.org/r/151275040665.24652.5188568529237584489.stgit= @devbox Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/probe-event.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index c3cd3488fee7..68786bb7790e 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -2625,6 +2625,14 @@ static int get_new_event_name(char *buf, size_t len,= const char *base, =20 out: free(nbase); + + /* Final validation */ + if (ret >=3D 0 && !is_c_func_name(buf)) { + pr_warning("Internal error: \"%s\" is an invalid event name.\n", + buf); + ret =3D -EINVAL; + } + return ret; } =20 --=20 2.14.1