Received: by 10.213.65.68 with SMTP id h4csp1677564imn; Mon, 19 Mar 2018 10:18:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELsyNueIjWk26znQF0g4UQNMD6DEJKpysTPgyKshozc74ZR52XPHeN9YWpwbXk+01yUhvclq X-Received: by 2002:a17:902:8c88:: with SMTP id t8-v6mr3615322plo.329.1521479895603; Mon, 19 Mar 2018 10:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521479895; cv=none; d=google.com; s=arc-20160816; b=T3lY4N1cvmPsv81crJ8d7sYMwMFkh/Sgvr94v9qMipIAocIg4AcBfUYki7I/1I1mG7 SMZtp9bWmfoKPKDLSsfE+nNAFoQABCJ56XjnG2ZtpYM6GzCW4jh3yy6LXgh42MF4pb/y Y5DcdcMdNMfZbU6Jb0O8MxxiB9XVd1B4YfDwQFI4KQbzToIAAiNfCwZw+2wjAu+xC0/L vTnZUvYZwJEHpTpqwXr8Z4+/vmLSDqJCGNExT/4Ff3cmXw433n/02hCbu8XkQbj9hW+T xGVardmHaw7QXzcZmXgwX6dS/SaheYXOd7vStvMsFWOhh1OTBgmjidqfPAnPJBx3wMWD 7deg== 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=4obMZAL8U3gfhewda4nOzl76zLnopHhNcJZxD9zxAX8=; b=aZWLV76bwpJGriy5Eljz1UeeLSFlOj13Ji+D4onkHe8BFbJLZiu/ZcS84IS1lCaJsb h0vysllfL9LyHNA0PC/lTudzbFn6wrvkPRVkNw4zrQ3ZIX5vmgjn6uqz3YYpPojru/kg 7PFgvMaCiNMGr7TtZWKL/JO/UCOsjc2+iayXzJVWNEApUCgr3ERy6lqHemLV8YvN+Clc Lvvf5oghh5X0aYyiDwhVO3qlSG8587Ih+5L7kvxUtXatfAGKhL8JeBcgq1Gju8kCJdrP oxyOXjarQAKzVfGm3uNrydGbsnv9y1WQ4CqGE3wfaYLQaWKiTmPEUJxZjncrSmmZQz5z TB7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=NRfnwBEa; 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 b25si219731pgf.200.2018.03.19.10.18.01; Mon, 19 Mar 2018 10:18:15 -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=NRfnwBEa; 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 S966555AbeCSQKC (ORCPT + 99 others); Mon, 19 Mar 2018 12:10:02 -0400 Received: from mail-sn1nam01on0111.outbound.protection.outlook.com ([104.47.32.111]:20373 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966407AbeCSQJK (ORCPT ); Mon, 19 Mar 2018 12:09:10 -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=4obMZAL8U3gfhewda4nOzl76zLnopHhNcJZxD9zxAX8=; b=NRfnwBEaqtrigrXcrpzBhWiwc80jQJWaoYAHIqUxxg1MUHFMUthEJ34EHStBVQtNQWwun0ekcNu8XDPRCXAQi7pyTciTkenxAU8oVm1d4z+WgyTlnSQWv/kl50Y+Dd8kGiTbj6CzvDbx4F6XwNv+lKmV4VeDo00kLg3Bg40Adwo= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0902.namprd21.prod.outlook.com (52.132.132.159) 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 16:09:06 +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 16:09:06 +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.4 084/167] perf probe: Add warning message if there is unexpected event name Thread-Topic: [PATCH AUTOSEL for 4.4 084/167] perf probe: Add warning message if there is unexpected event name Thread-Index: AQHTv5xU+BQnRqAn0UagYpGGQpYzaQ== Date: Mon, 19 Mar 2018 16:07:07 +0000 Message-ID: <20180319160513.16384-84-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-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;DM5PR2101MB0902;7:YbIYCAW0IoPJlcgRxUIzBX8FH8VPZqXXJdHHdZLl4jXT+4Ho5iSeuRhjR1Jx0ZexT3roQKxCfWUBEHRjBjWN96H4EbInjMpz1SnNEdMouweZB2l517CMSkwaWwZNlGNoShS2IZHjEXX48qTGUY/omFlIzZUUjUHCaXkxCHkNHUUEdiG//5p8oydJuqJ7FyEUvo5argjVK9p/e0PRQX6E53evy4l5Fk1whh/Az/gF7r+edewGbwisS3RI4Vs03yF9;20:zu9ijpeZYRZJsDHnASN9lmwQlvyA2JsYYbT+vohrYqo4Y3rEwkc5cjT6eSbI4fK8qnKy4hEUNhJvckm0HBR96mC4MGElanQcS/OOJlRryNobvlopY9Q/M3JJgUxJyrlqzBdBTPhQk+mqKlmqqTOY33Ijnoe8YF2Uy6X6QY7fcS4= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ed0cc189-b4b7-49ad-5813-08d58db3bd9d x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0902; x-ms-traffictypediagnostic: DM5PR2101MB0902: 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)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0902;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0902; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(39860400002)(396003)(39380400002)(376002)(199004)(189003)(4326008)(305945005)(7736002)(66066001)(105586002)(316002)(8676002)(25786009)(8936002)(2950100002)(5660300001)(97736004)(39060400002)(81166006)(81156014)(3280700002)(22452003)(8656006)(99286004)(186003)(2906002)(10710500007)(76176011)(5250100002)(59450400001)(54906003)(10090500001)(110136005)(6116002)(2900100001)(3846002)(2501003)(1076002)(86612001)(107886003)(106356001)(6436002)(6512007)(6306002)(575784001)(86362001)(53936002)(6506007)(6486002)(26005)(14454004)(10290500003)(102836004)(15650500001)(68736007)(7110500001)(3660700001)(478600001)(966005)(72206003)(36756003)(2420400007)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0902;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: amBRICHaHB3vKQLdQe0lvwb666GgZt6z0lIbGSLQKiXxuWmMx6Y7nNXWgXQqErXjpxGd4wgjbX9B54BUXTQQxHJJ1Egfm9iAfVpYdOs/9yoPJwSfpmubuVGAOay04wZ1mxFEEvmJSTREk6+k6CHnpNibOk8ZSjI3ADTvtrbfBH5mgFQ2VeVKYdIaTyK7h2jkq7o+ojZvhFwNcOuZT53PGABwOL5yrK1Y0mPf+Z92Ky/e3xGm4RfViJd1dK+KuWpWX2B96ylL4wV831VFVOvl6aMAH0++g8fckm38JWp5Dreg86mSBLG/7zw0GWDZU6j3qTCDJpoNVwre8+38AoNqFA== 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: ed0cc189-b4b7-49ad-5813-08d58db3bd9d X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:07:07.5560 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0902 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 03875f9154e7..0195b7e8c54a 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -2349,6 +2349,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