Received: by 10.192.165.156 with SMTP id m28csp49626imm; Tue, 10 Apr 2018 16:09:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/As3b6Ctk4fDkxvSqlFAgOH3EkyLyCYggtgZA8akHH+VhGOTj05BFIskecNTF+kfqI72VS X-Received: by 10.99.119.74 with SMTP id s71mr1616175pgc.321.1523401757364; Tue, 10 Apr 2018 16:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401757; cv=none; d=google.com; s=arc-20160816; b=SNhgHefjHI7pbpyjUzHV2lGYcsNkKbXS9sO8+RBd2NKNlIdqx/1BPRw1SWP35pES4r iDIsmdIJjynmu1j9jaGOK1tIk3M9jfB7Uw/9nenESITjZ979HMk2CTxCk77qps5Tm3j7 LqWQ7Q5Gff3Twq/9TUc6d+ROby/nfJJv1a3jpERmUyJH5MPEZnWDZ/cORMKAyHBmqWMj q4TyyfQ/bsZkqP8WapdfMQNBq3KWsliHvv9TEyLbqAG9ZSO8AHxocNcjnsKWGX8LbNGc 2/Yuqm1UmjLWbG0S4NhX93qtHykcb+1xotQU2cG6MPjHOPAmvvtSFfvz+gb8IqrZilVB /Wgw== 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=aTc2eHrnZODLUpz94HZaaFoSCs8L6CiJwiQ8ufNtBWI=; b=PQzttsisdJ4LSc3hmavRjpfrdju6CHyIw7zr+X6MnH1Xbso9MELyqxIgjkFebNrAuC G9V/nN3hglNjYXnTz/amHBdqZZeebRCEMqoxzTRkn6q/oQxRULM/RWLGtAOhJibwbptt ESHCAyoQJqBviOGl5eZWWtHczi+nFzQsyl+bAJ+38TwHSsZ73P0DGWk5sHZhe0JS/jDZ GIDWbTRNi6dhrfbk1R39K9dq9VT1vASbZkQoEJIG+jiJa51h5ImXUgrAXsKFhagerC9l W6Xadym3u87u+vfZFxXWFFn/lLBkkpU+KUJIAvO+qbq4pwq3IzTw6KVjTGrBhsuoIOCo 1xDw== 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 134si2429919pgd.709.2018.04.10.16.08.40; Tue, 10 Apr 2018 16:09:17 -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 S932227AbeDJWfC (ORCPT + 99 others); Tue, 10 Apr 2018 18:35:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41930 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932216AbeDJWe4 (ORCPT ); Tue, 10 Apr 2018 18:34:56 -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 A3AACCDB; Tue, 10 Apr 2018 22:34:55 +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.14 010/138] perf probe: Add warning message if there is unexpected event name Date: Wed, 11 Apr 2018 00:23:20 +0200 Message-Id: <20180410212903.361416262@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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.14-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; }