]> git.baikalelectronics.ru Git - kernel.git/commit
perf, pt, coresight: Fix address filters for vmas with non-zero offset
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Fri, 15 Feb 2019 11:56:55 +0000 (13:56 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 22 Feb 2019 19:52:07 +0000 (16:52 -0300)
commit42de13f0d0cd2080cdad8952361204b14fd82995
treeb17b0a30fab156a840ab55518337db38f6e9fac7
parentf635d56f9f72f033456fa7e9221ef0b9fb8e5583
perf, pt, coresight: Fix address filters for vmas with non-zero offset

Currently, the address range calculation for file-based filters works as
long as the vma that maps the matching part of the object file starts
from offset zero into the file (vm_pgoff==0). Otherwise, the resulting
filter range would be off by vm_pgoff pages. Another related problem is
that in case of a partially matching vma, that is, a vma that matches
part of a filter region, the filter range size wouldn't be adjusted.

Fix the arithmetics around address filter range calculations, taking
into account vma offset, so that the entire calculation is done before
the filter configuration is passed to the PMU drivers instead of having
those drivers do the final bit of arithmetics.

Based on the patch by Adrian Hunter <adrian.hunter.intel.com>.

Reported-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Tested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Fixes: aeab82993f45 ("perf/core: Introduce address range filtering")
Link: http://lkml.kernel.org/r/20190215115655.63469-3-alexander.shishkin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
arch/x86/events/intel/pt.c
drivers/hwtracing/coresight/coresight-etm-perf.c
include/linux/perf_event.h
kernel/events/core.c