[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180410212800.657227015@linuxfoundation.org>
Date: Wed, 11 Apr 2018 00:22:32 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Arnaldo Carvalho de Melo <acme@...hat.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>,
Thomas Richter <tmricht@...ux.vnet.ibm.com>,
Paul Clarke <pc@...ibm.com>,
bhargavb <bhargavaramudu@...il.com>,
linux-rt-users@...r.kernel.org,
Sasha Levin <alexander.levin@...rosoft.com>
Subject: [PATCH 4.15 010/168] perf probe: Add warning message if there is unexpected event name
4.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu <mhiramat@...nel.org>
[ 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@...BC_2" is an invalid event name.
Error: Failed to add events.
======
Reported-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
Acked-by: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Reviewed-by: Thomas Richter <tmricht@...ux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Paul Clarke <pc@...ibm.com>
Cc: bhargavb <bhargavaramudu@...il.com>
Cc: linux-rt-users@...r.kernel.org
Link: http://lkml.kernel.org/r/151275040665.24652.5188568529237584489.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
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;
}
Powered by blists - more mailing lists