perf/core: Fix file name handling for start/stop filters

This change “perf/core: Fix file name handling for start/stop filters” in Linux kernel is authored by Mathieu Poirier <mathieu.poirier [at]> on Mon Jul 18 10:43:05 2016 -0600.

perf/core: Fix file name handling for start/stop filters

Binary file names have to be supplied for both range and start/stop
filters but the current code only processes the filename if an
address range filter is specified.  This code adds processing of
the filename for start/stop filters.

Signed-off-by: Mathieu Poirier <>
Signed-off-by: Peter Zijlstra (Intel) <>
Acked-by: Alexander Shishkin <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Jiri Olsa <>
Cc: Linus Torvalds <>
Cc: Peter Zijlstra <>
Cc: Stephane Eranian <>
Cc: Thomas Gleixner <>
Cc: Vince Weaver <>
Signed-off-by: Ingo Molnar <>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 4059ffd.

There are 6 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 kernel/events/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 6e454bf..52780ef 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7972,8 +7972,10 @@ enum {
 					goto fail;
-			if (token == IF_SRC_FILE) {
-				filename = match_strdup(&args[2]);
+			if (token == IF_SRC_FILE || token == IF_SRC_FILEADDR) {
+				int fpos = filter->range ? 2 : 1;
+				filename = match_strdup(&args[fpos]);
 				if (!filename) {
 					ret = -ENOMEM;
 					goto fail;

The commit for this change in Linux stable tree is 4059ffd (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *