All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering
@ 2016-07-18 16:43 Mathieu Poirier
  2016-07-18 16:43 ` [PATCH V2 1/3] perf/core: Fixing filename for start/stop filters Mathieu Poirier
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Mathieu Poirier @ 2016-07-18 16:43 UTC (permalink / raw)
  To: alexander.shishkin; +Cc: peterz, mingo, linux-kernel, Mathieu Poirier

This is the second wave of a patchset that address miscellaneous bugs
encountered while implementing address filtering on CoreSight.

The set has been tested, and applies cleanly, on 4.7-rc7.

Thanks,
Mathieu

Changes since V1:
. Simplified filename handling in function
  perf_event_parse_addr_filter().
. Moved check to see if mapped event was for executable
  code to function perf_addr_filters_adjust().
. Got rid of function perf_addr_filter_needs_mmap(). 

Mathieu Poirier (3):
  perf/core: Fixing filename for start/stop filters
  perf/core: Update filter only on executable mmap
  perf/core: Enabling mapping of the stop filters

 kernel/events/core.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V2 1/3] perf/core: Fixing filename for start/stop filters
  2016-07-18 16:43 [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering Mathieu Poirier
@ 2016-07-18 16:43 ` Mathieu Poirier
  2016-08-18 10:51   ` [tip:perf/core] perf/core: Fix file name handling " tip-bot for Mathieu Poirier
  2016-07-18 16:43 ` [PATCH V2 2/3] perf/core: Update filter only on executable mmap Mathieu Poirier
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Mathieu Poirier @ 2016-07-18 16:43 UTC (permalink / raw)
  To: alexander.shishkin; +Cc: peterz, mingo, linux-kernel, Mathieu Poirier

Binary file names have to be supplied for both range and start/stop
filters but the current code only process 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 <mathieu.poirier@linaro.org>
---
 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 912f10dfbfe5..a8371814dbf4 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7852,8 +7852,10 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
 					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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2 2/3] perf/core: Update filter only on executable mmap
  2016-07-18 16:43 [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering Mathieu Poirier
  2016-07-18 16:43 ` [PATCH V2 1/3] perf/core: Fixing filename for start/stop filters Mathieu Poirier
@ 2016-07-18 16:43 ` Mathieu Poirier
  2016-08-18 10:51   ` [tip:perf/core] perf/core: Update filters " tip-bot for Mathieu Poirier
  2016-07-18 16:43 ` [PATCH V2 3/3] perf/core: Enabling mapping of the stop filters Mathieu Poirier
  2016-07-19  7:30 ` [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering Alexander Shishkin
  3 siblings, 1 reply; 8+ messages in thread
From: Mathieu Poirier @ 2016-07-18 16:43 UTC (permalink / raw)
  To: alexander.shishkin; +Cc: peterz, mingo, linux-kernel, Mathieu Poirier, # 4 . 7

Function perf_event_mmap() is called by the MM subsystem each time
part of a binary is loaded in memory.  There can be several mapping
for a binary, many times unrelated to the code section.

Each time a section of a binary is mapped address filters are
updated, event when the map doesn't pertain to the code section.
The end result is that filters are configured based on the last map
event that was received rather than the last mapping of the code
segment.

For example if we have an executable 'main' that calls library
'libcstest.so.1.0', and that we want to collect traces on code
that is in that library.  The perf cmd line for this scenario
would be:

perf record -e cs_etm// --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thread ./main

Resulting in binaries being mapped this way:

root@linaro-nano:~# cat /proc/1950/maps
00400000-00401000 r-xp 00000000 08:02 33169     /home/linaro/main
00410000-00411000 r--p 00000000 08:02 33169     /home/linaro/main
00411000-00412000 rw-p 00001000 08:02 33169     /home/linaro/main
7fa2464000-7fa2474000 rw-p 00000000 00:00 0
7fa2474000-7fa25a4000 r-xp 00000000 08:02 543   /lib/aarch64-linux-gnu/libc-2.21.so
7fa25a4000-7fa25b3000 ---p 00130000 08:02 543   /lib/aarch64-linux-gnu/libc-2.21.so
7fa25b3000-7fa25b7000 r--p 0012f000 08:02 543   /lib/aarch64-linux-gnu/libc-2.21.so
7fa25b7000-7fa25b9000 rw-p 00133000 08:02 543   /lib/aarch64-linux-gnu/libc-2.21.so
7fa25b9000-7fa25bd000 rw-p 00000000 00:00 0
7fa25bd000-7fa25be000 r-xp 00000000 08:02 38308 /opt/lib/libcstest.so.1.0
7fa25be000-7fa25cd000 ---p 00001000 08:02 38308 /opt/lib/libcstest.so.1.0
7fa25cd000-7fa25ce000 r--p 00000000 08:02 38308 /opt/lib/libcstest.so.1.0
7fa25ce000-7fa25cf000 rw-p 00001000 08:02 38308 /opt/lib/libcstest.so.1.0
7fa25cf000-7fa25eb000 r-xp 00000000 08:02 574   /lib/aarch64-linux-gnu/ld-2.21.so
7fa25ef000-7fa25f2000 rw-p 00000000 00:00 0
7fa25f7000-7fa25f9000 rw-p 00000000 00:00 0
7fa25f9000-7fa25fa000 r--p 00000000 00:00 0     [vvar]
7fa25fa000-7fa25fb000 r-xp 00000000 00:00 0     [vdso]
7fa25fb000-7fa25fc000 r--p 0001c000 08:02 574   /lib/aarch64-linux-gnu/ld-2.21.so
7fa25fc000-7fa25fe000 rw-p 0001d000 08:02 574   /lib/aarch64-linux-gnu/ld-2.21.so
7ff2ea8000-7ff2ec9000 rw-p 00000000 00:00 0     [stack]
root@linaro-nano:~#

Before 'main' can execute 'libcstest.so.1.0' has to be loaded in
memory.  Once that has been done perf_event_mmap() has been called
4 times, with the last map starting at address 0x7fa25ce000 and
the address filter configured to start filtering when the
IP has passed over address 0x0x7fa25ce72c (0x7fa25ce000 + 0x72c).

But that is wrong since the code segment for library 'libcstest.so.1.0'
as been mapped at 0x7fa25bd000, resulting in traces not being
collected.

This patch corrects the situation by requesting that address
filters be updated only if the mapped event is for a code
segment.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: <stable@vger.kernel.org> # 4.7
---
 kernel/events/core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index a8371814dbf4..f2bb2a0fae2b 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6562,6 +6562,13 @@ static void perf_addr_filters_adjust(struct vm_area_struct *vma)
 	struct perf_event_context *ctx;
 	int ctxn;
 
+	/*
+	 * Data tracing isn't supported yet and as such there is no need
+	 * to keep track of anything that isn't related to executable code.
+	 */
+	if (!(vma->vm_flags & VM_EXEC))
+		return;
+
 	rcu_read_lock();
 	for_each_task_context_nr(ctxn) {
 		ctx = rcu_dereference(current->perf_event_ctxp[ctxn]);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH V2 3/3] perf/core: Enabling mapping of the stop filters
  2016-07-18 16:43 [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering Mathieu Poirier
  2016-07-18 16:43 ` [PATCH V2 1/3] perf/core: Fixing filename for start/stop filters Mathieu Poirier
  2016-07-18 16:43 ` [PATCH V2 2/3] perf/core: Update filter only on executable mmap Mathieu Poirier
@ 2016-07-18 16:43 ` Mathieu Poirier
  2016-08-18 10:52   ` [tip:perf/core] perf/core: Enable " tip-bot for Mathieu Poirier
  2016-07-19  7:30 ` [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering Alexander Shishkin
  3 siblings, 1 reply; 8+ messages in thread
From: Mathieu Poirier @ 2016-07-18 16:43 UTC (permalink / raw)
  To: alexander.shishkin; +Cc: peterz, mingo, linux-kernel, Mathieu Poirier

At this time function perf_addr_filter_needs_mmap() will _not_
return true on a user space 'stop' filter.  But stop filters
needs exactly the same kind of mapping that range and start
filters get.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 kernel/events/core.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index f2bb2a0fae2b..6768ac4a2fcf 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6493,15 +6493,6 @@ got_name:
 }
 
 /*
- * Whether this @filter depends on a dynamic object which is not loaded
- * yet or its load addresses are not known.
- */
-static bool perf_addr_filter_needs_mmap(struct perf_addr_filter *filter)
-{
-	return filter->filter && filter->inode;
-}
-
-/*
  * Check whether inode and address range match filter criteria.
  */
 static bool perf_addr_filter_match(struct perf_addr_filter *filter,
@@ -7728,7 +7719,11 @@ static void perf_event_addr_filters_apply(struct perf_event *event)
 	list_for_each_entry(filter, &ifh->list, entry) {
 		event->addr_filters_offs[count] = 0;
 
-		if (perf_addr_filter_needs_mmap(filter))
+		/*
+		 * Adjust base offset if the filter is associated to a binary
+		 * that needs to be mapped.
+		 */
+		if (filter->inode)
 			event->addr_filters_offs[count] =
 				perf_addr_filter_apply(filter, mm);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering
  2016-07-18 16:43 [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering Mathieu Poirier
                   ` (2 preceding siblings ...)
  2016-07-18 16:43 ` [PATCH V2 3/3] perf/core: Enabling mapping of the stop filters Mathieu Poirier
@ 2016-07-19  7:30 ` Alexander Shishkin
  3 siblings, 0 replies; 8+ messages in thread
From: Alexander Shishkin @ 2016-07-19  7:30 UTC (permalink / raw)
  To: Mathieu Poirier; +Cc: peterz, mingo, linux-kernel, Mathieu Poirier

Mathieu Poirier <mathieu.poirier@linaro.org> writes:

> This is the second wave of a patchset that address miscellaneous bugs
> encountered while implementing address filtering on CoreSight.
>
> The set has been tested, and applies cleanly, on 4.7-rc7.

Thanks!

FWIW, this series:

Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>

Regards,
--
Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [tip:perf/core] perf/core: Fix file name handling for start/stop filters
  2016-07-18 16:43 ` [PATCH V2 1/3] perf/core: Fixing filename for start/stop filters Mathieu Poirier
@ 2016-08-18 10:51   ` tip-bot for Mathieu Poirier
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Mathieu Poirier @ 2016-08-18 10:51 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mathieu.poirier, torvalds, tglx, linux-kernel, jolsa,
	alexander.shishkin, vincent.weaver, peterz, acme, mingo, hpa,
	eranian

Commit-ID:  4059ffd09d694f704e18a4baf97fc0016c32e9ad
Gitweb:     http://git.kernel.org/tip/4059ffd09d694f704e18a4baf97fc0016c32e9ad
Author:     Mathieu Poirier <mathieu.poirier@linaro.org>
AuthorDate: Mon, 18 Jul 2016 10:43:05 -0600
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 18 Aug 2016 10:35:50 +0200

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 <mathieu.poirier@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1468860187-318-2-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
 					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;

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [tip:perf/core] perf/core: Update filters only on executable mmap
  2016-07-18 16:43 ` [PATCH V2 2/3] perf/core: Update filter only on executable mmap Mathieu Poirier
@ 2016-08-18 10:51   ` tip-bot for Mathieu Poirier
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Mathieu Poirier @ 2016-08-18 10:51 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: peterz, eranian, jolsa, mingo, hpa, linux-kernel,
	mathieu.poirier, alexander.shishkin, tglx, vincent.weaver,
	torvalds, acme

Commit-ID:  12b40a2393719a37ff86a0b43bece6d28a75cbfc
Gitweb:     http://git.kernel.org/tip/12b40a2393719a37ff86a0b43bece6d28a75cbfc
Author:     Mathieu Poirier <mathieu.poirier@linaro.org>
AuthorDate: Mon, 18 Jul 2016 10:43:06 -0600
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 18 Aug 2016 10:35:50 +0200

perf/core: Update filters only on executable mmap

Function perf_event_mmap() is called by the MM subsystem each time
part of a binary is loaded in memory.  There can be several mapping
for a binary, many times unrelated to the code section.

Each time a section of a binary is mapped address filters are
updated, event when the map doesn't pertain to the code section.
The end result is that filters are configured based on the last map
event that was received rather than the last mapping of the code
segment.

For example if we have an executable 'main' that calls library
'libcstest.so.1.0', and that we want to collect traces on code
that is in that library.  The perf cmd line for this scenario
would be:

  perf record -e cs_etm// --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thread ./main

Resulting in binaries being mapped this way:

  root@linaro-nano:~# cat /proc/1950/maps
  00400000-00401000 r-xp 00000000 08:02 33169     /home/linaro/main
  00410000-00411000 r--p 00000000 08:02 33169     /home/linaro/main
  00411000-00412000 rw-p 00001000 08:02 33169     /home/linaro/main
  7fa2464000-7fa2474000 rw-p 00000000 00:00 0
  7fa2474000-7fa25a4000 r-xp 00000000 08:02 543   /lib/aarch64-linux-gnu/libc-2.21.so
  7fa25a4000-7fa25b3000 ---p 00130000 08:02 543   /lib/aarch64-linux-gnu/libc-2.21.so
  7fa25b3000-7fa25b7000 r--p 0012f000 08:02 543   /lib/aarch64-linux-gnu/libc-2.21.so
  7fa25b7000-7fa25b9000 rw-p 00133000 08:02 543   /lib/aarch64-linux-gnu/libc-2.21.so
  7fa25b9000-7fa25bd000 rw-p 00000000 00:00 0
  7fa25bd000-7fa25be000 r-xp 00000000 08:02 38308 /opt/lib/libcstest.so.1.0
  7fa25be000-7fa25cd000 ---p 00001000 08:02 38308 /opt/lib/libcstest.so.1.0
  7fa25cd000-7fa25ce000 r--p 00000000 08:02 38308 /opt/lib/libcstest.so.1.0
  7fa25ce000-7fa25cf000 rw-p 00001000 08:02 38308 /opt/lib/libcstest.so.1.0
  7fa25cf000-7fa25eb000 r-xp 00000000 08:02 574   /lib/aarch64-linux-gnu/ld-2.21.so
  7fa25ef000-7fa25f2000 rw-p 00000000 00:00 0
  7fa25f7000-7fa25f9000 rw-p 00000000 00:00 0
  7fa25f9000-7fa25fa000 r--p 00000000 00:00 0     [vvar]
  7fa25fa000-7fa25fb000 r-xp 00000000 00:00 0     [vdso]
  7fa25fb000-7fa25fc000 r--p 0001c000 08:02 574   /lib/aarch64-linux-gnu/ld-2.21.so
  7fa25fc000-7fa25fe000 rw-p 0001d000 08:02 574   /lib/aarch64-linux-gnu/ld-2.21.so
  7ff2ea8000-7ff2ec9000 rw-p 00000000 00:00 0     [stack]
  root@linaro-nano:~#

Before 'main()' can execute 'libcstest.so.1.0' has to be loaded in
memory.  Once that has been done perf_event_mmap() has been called
4 times, with the last map starting at address 0x7fa25ce000 and
the address filter configured to start filtering when the
IP has passed over address 0x0x7fa25ce72c (0x7fa25ce000 + 0x72c).

But that is wrong since the code segment for library 'libcstest.so.1.0'
as been mapped at 0x7fa25bd000, resulting in traces not being
collected.

This patch corrects the situation by requesting that address
filters be updated only if the mapped event is for a code
segment.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1468860187-318-3-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/events/core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 52780ef..9a030a9 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6689,6 +6689,13 @@ static void perf_addr_filters_adjust(struct vm_area_struct *vma)
 	struct perf_event_context *ctx;
 	int ctxn;
 
+	/*
+	 * Data tracing isn't supported yet and as such there is no need
+	 * to keep track of anything that isn't related to executable code:
+	 */
+	if (!(vma->vm_flags & VM_EXEC))
+		return;
+
 	rcu_read_lock();
 	for_each_task_context_nr(ctxn) {
 		ctx = rcu_dereference(current->perf_event_ctxp[ctxn]);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [tip:perf/core] perf/core: Enable mapping of the stop filters
  2016-07-18 16:43 ` [PATCH V2 3/3] perf/core: Enabling mapping of the stop filters Mathieu Poirier
@ 2016-08-18 10:52   ` tip-bot for Mathieu Poirier
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Mathieu Poirier @ 2016-08-18 10:52 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, eranian, torvalds, peterz, mingo, mathieu.poirier, acme,
	alexander.shishkin, linux-kernel, tglx, vincent.weaver, jolsa

Commit-ID:  99f5bc9bfa9094e7c264a8e09f9507b391a3d1d1
Gitweb:     http://git.kernel.org/tip/99f5bc9bfa9094e7c264a8e09f9507b391a3d1d1
Author:     Mathieu Poirier <mathieu.poirier@linaro.org>
AuthorDate: Mon, 18 Jul 2016 10:43:07 -0600
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 18 Aug 2016 10:35:51 +0200

perf/core: Enable mapping of the stop filters

At this time the perf_addr_filter_needs_mmap() function will _not_
return true on a user space 'stop' filter.  But stop filters need
exactly the same kind of mapping that range and start filters get.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1468860187-318-4-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/events/core.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9a030a9..a5fc5c8 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6620,15 +6620,6 @@ got_name:
 }
 
 /*
- * Whether this @filter depends on a dynamic object which is not loaded
- * yet or its load addresses are not known.
- */
-static bool perf_addr_filter_needs_mmap(struct perf_addr_filter *filter)
-{
-	return filter->filter && filter->inode;
-}
-
-/*
  * Check whether inode and address range match filter criteria.
  */
 static bool perf_addr_filter_match(struct perf_addr_filter *filter,
@@ -7848,7 +7839,11 @@ static void perf_event_addr_filters_apply(struct perf_event *event)
 	list_for_each_entry(filter, &ifh->list, entry) {
 		event->addr_filters_offs[count] = 0;
 
-		if (perf_addr_filter_needs_mmap(filter))
+		/*
+		 * Adjust base offset if the filter is associated to a binary
+		 * that needs to be mapped:
+		 */
+		if (filter->inode)
 			event->addr_filters_offs[count] =
 				perf_addr_filter_apply(filter, mm);
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-18 10:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-18 16:43 [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering Mathieu Poirier
2016-07-18 16:43 ` [PATCH V2 1/3] perf/core: Fixing filename for start/stop filters Mathieu Poirier
2016-08-18 10:51   ` [tip:perf/core] perf/core: Fix file name handling " tip-bot for Mathieu Poirier
2016-07-18 16:43 ` [PATCH V2 2/3] perf/core: Update filter only on executable mmap Mathieu Poirier
2016-08-18 10:51   ` [tip:perf/core] perf/core: Update filters " tip-bot for Mathieu Poirier
2016-07-18 16:43 ` [PATCH V2 3/3] perf/core: Enabling mapping of the stop filters Mathieu Poirier
2016-08-18 10:52   ` [tip:perf/core] perf/core: Enable " tip-bot for Mathieu Poirier
2016-07-19  7:30 ` [PATCH V2 0/3] perf/core: Miscellaneous fix for address filtering Alexander Shishkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.