Received: by 10.192.165.156 with SMTP id m28csp75204imm; Tue, 10 Apr 2018 16:45:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx49XOgCu5jTWhM/ml5Z8ByDUMvjRRqAksGZkrGSHSvm1KC9BBQZuOoOPDPe9TzJlGiQap+51 X-Received: by 2002:a17:902:4225:: with SMTP id g34-v6mr2524848pld.297.1523403955034; Tue, 10 Apr 2018 16:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403954; cv=none; d=google.com; s=arc-20160816; b=CifDTe11NBsAs+vI8R/9SYwpvzC7RC2R3Y6H52x4MWhQjIvwNPjm6QKbBpi0z/vkV/ itWBWUpOwLA6zWGFucPDfxaaNAR80kCFrYP7OaZgAOOpk9Jn7w1njB4LTxC6rI+xlcdU 79Jx7NlAQtHH+DJChe0BJIce/wbqyA2d9b28kNkmondahxv/z7oa8r+pt7jCi5VP89ug wgS7aUtWH0aUk7P+7byyx7GbVVGP76WMkYPQuJDm1oLxgB3af1MHv3DRZVjRW9siVGxP ajrG1EcLYwJIhKzVMzSqHMdqIcpQYOhrtKDrr2bu0xOuZNx6Y5gtz95IMTRoQ4WtPW40 y01g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=h4C+DiDZiJ0XkFkLbJuZgRE7+hPy416t5uUYJcDaqmo=; b=FHpRI/ft0KbBgwRZVZzMP3BJOlfCNQoJIdvl7pN28ZzU5NGqxnoHmLy92q9+VZFXXM K/QStLgzKKVXKzx3GG34Nnec24v7pgQl77/juYXT860jdutP5byp//NJXk6pOViod2Xn B/YFV18YnHcKJPozi/pNIbfm8yTtwPxr4orfttqP6u2SaBDzC6dg/IH1xRX8l6cG2l+j kWCjdMx4dYJV8tGzLYNS/r5TfmBGaExWNOUBUaWa4zouXVPAjgkNQFMyLWx8rxLz/d8U WI/iKJXqCYSYmOPXFLhQOsg2ERFsB7424J4LwMSdZpOWxBwemJF8vs3n0z4UWpVqtLG7 Hbhg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si345080pgs.525.2018.04.10.16.45.18; Tue, 10 Apr 2018 16:45:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753800AbeDJXlK (ORCPT + 99 others); Tue, 10 Apr 2018 19:41:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37206 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbeDJW02 (ORCPT ); Tue, 10 Apr 2018 18:26:28 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6E34CDC3; Tue, 10 Apr 2018 22:26:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnaldo Carvalho de Melo , Masami Hiramatsu , Ravi Bangoria , Thomas Richter , Paul Clarke , bhargavb , linux-rt-users@vger.kernel.org, Sasha Levin Subject: [PATCH 4.15 010/168] perf probe: Add warning message if there is unexpected event name Date: Wed, 11 Apr 2018 00:22:32 +0200 Message-Id: <20180410212800.657227015@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ 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. ====== #./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. ====== 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 Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/probe-event.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- 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, out: free(nbase); + + /* Final validation */ + if (ret >= 0 && !is_c_func_name(buf)) { + pr_warning("Internal error: \"%s\" is an invalid event name.\n", + buf); + ret = -EINVAL; + } + return ret; }