Skip to content

Commit

Permalink
perf/core: Enable mapping of the stop filters
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mathieupoirier authored and Ingo Molnar committed Aug 18, 2016
1 parent 12b40a2 commit 99f5bc9
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6619,15 +6619,6 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
kfree(buf);
}

/*
* 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.
*/
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 99f5bc9

Please sign in to comment.