linux-stable/tools/perf
Li Bin 2c29461e27 perf probe: Fix kprobe blacklist checking condition
The commit 9aaf5a5f47 ("perf probe: Check kprobes blacklist when
adding new events"), 'perf probe' supports checking the blacklist of the
fuctions which can not be probed.  But the checking condition is wrong,
that the end_addr of the symbol which is the start_addr of the next
symbol can't be included.

Committer notes:

IOW make it match its kernel counterpart in kernel/kprobes.c:

  bool within_kprobe_blacklist(unsigned long addr)

Each entry have as its end address not its end address, but the first
address _outside_ that symbol, which for related functions, is the first
address of the next symbol, like these from kernel/trace/trace_probe.c:

0xffffffffbd198df0-0xffffffffbd198e40	print_type_u8
0xffffffffbd198e40-0xffffffffbd198e90	print_type_u16
0xffffffffbd198e90-0xffffffffbd198ee0	print_type_u32
0xffffffffbd198ee0-0xffffffffbd198f30	print_type_u64
0xffffffffbd198f30-0xffffffffbd198f80	print_type_s8
0xffffffffbd198f80-0xffffffffbd198fd0	print_type_s16
0xffffffffbd198fd0-0xffffffffbd199020	print_type_s32
0xffffffffbd199020-0xffffffffbd199070	print_type_s64
0xffffffffbd199070-0xffffffffbd1990c0	print_type_x8
0xffffffffbd1990c0-0xffffffffbd199110	print_type_x16
0xffffffffbd199110-0xffffffffbd199160	print_type_x32
0xffffffffbd199160-0xffffffffbd1991b0	print_type_x64

But not always:

0xffffffffbd1997b0-0xffffffffbd1997c0	fetch_kernel_stack_address (kernel/trace/trace_probe.c)
0xffffffffbd1c57f0-0xffffffffbd1c58b0	__context_tracking_enter   (kernel/context_tracking.c)

Signed-off-by: Li Bin <huawei.libin@huawei.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: zhangmengting@huawei.com
Fixes: 9aaf5a5f47 ("perf probe: Check kprobes blacklist when adding new events")
Link: http://lkml.kernel.org/r/1504011443-7269-1-git-send-email-huawei.libin@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-08-29 11:14:12 -03:00
..
arch perf report: Fix module symbol adjustment for s390x 2017-08-11 16:06:32 -03:00
bench perf tools: Use __maybe_unused consistently 2017-06-19 15:27:06 -03:00
Documentation perf stat: Fix path to PMU formats in documentation 2017-08-28 11:05:09 -03:00
jvmti perf jit: fix typo: "incalid" -> "invalid" 2017-06-27 11:55:06 -03:00
pmu-events perf vendor events: Add Skylake server uncore event list 2017-08-22 12:25:11 -03:00
python perf python: Add tracepoint example 2016-07-12 16:23:35 -03:00
scripts perf script python: Add support for sqlite3 to call-graph-from-sql.py 2017-08-15 17:03:38 -03:00
tests perf test: Add test cases for new data source encoding 2017-08-22 13:23:10 -03:00
trace perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments 2017-08-28 16:44:47 -03:00
ui perf annotate browser: Circulate percent, total-period and nr-samples view 2017-08-18 11:23:20 -03:00
util perf probe: Fix kprobe blacklist checking condition 2017-08-29 11:14:12 -03:00
.gitignore perf tools: Ignore generated files pmu-events/{jevents,pmu-events.c} for git 2017-03-13 10:59:36 -03:00
Build perf trace: Only build tools/perf/trace/beauty/ when building 'perf trace' 2017-07-18 23:13:52 -03:00
builtin-annotate.c perf annotate browser: Support --show-nr-samples option 2017-08-18 11:15:09 -03:00
builtin-bench.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-buildid-cache.c perf buildid-cache: Cache debuginfo 2017-07-18 23:14:11 -03:00
builtin-buildid-list.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-c2c.c perf tools: Replace error() with pr_err() 2017-06-27 11:22:31 -03:00
builtin-config.c tools include: Adopt strstarts() from the kernel 2017-07-20 15:46:10 -03:00
builtin-data.c perf data: Add doc when no conversion support compiled 2017-07-28 16:30:45 -03:00
builtin-diff.c perf config: Do not die when parsing u64 or int config values 2017-06-27 11:44:58 -03:00
builtin-evlist.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-ftrace.c tools include: Adopt strstarts() from the kernel 2017-07-20 15:46:10 -03:00
builtin-help.c tools include: Adopt strstarts() from the kernel 2017-07-20 15:46:10 -03:00
builtin-inject.c perf tools: Add feature header record to pipe-mode 2017-07-18 23:14:36 -03:00
builtin-kallsyms.c perf tools: Including missing inttypes.h header 2017-04-19 13:01:46 -03:00
builtin-kmem.c mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic 2017-07-12 16:26:03 -07:00
builtin-kvm.c perf tools: Remove poll.h and wait.h from util.h 2017-04-24 13:43:34 -03:00
builtin-list.c perf tools: Remove unused 'prefix' from builtin functions 2017-03-27 11:58:09 -03:00
builtin-lock.c perf tools: Include errno.h where needed 2017-04-19 13:01:51 -03:00
builtin-mem.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-probe.c perf buildid-cache: Support binary objects from other namespaces 2017-07-18 23:14:11 -03:00
builtin-record.c perf tools: Add feature header record to pipe-mode 2017-07-18 23:14:36 -03:00
builtin-report.c perf report: Group stat values on global event id 2017-08-28 16:44:44 -03:00
builtin-sched.c perf tools: Replace error() with pr_err() 2017-06-27 11:22:31 -03:00
builtin-script.c perf script: Remove some bogus error handling 2017-07-25 22:43:17 -03:00
builtin-stat.c perf stat: Use group read for event groups 2017-07-26 14:25:44 -03:00
builtin-timechart.c perf tools: Use just forward declarations for struct thread where possible 2017-04-24 13:43:35 -03:00
builtin-top.c perf top: Support lookup of symbols in other mount namespaces. 2017-07-25 22:43:16 -03:00
builtin-trace.c perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments 2017-08-28 16:44:47 -03:00
builtin-version.c perf tools: Remove string.h, unistd.h and sys/stat.h from util.h 2017-04-24 13:43:33 -03:00
builtin.h perf tools: Remove stale prototypes from builtin.h 2017-04-24 13:43:33 -03:00
check-headers.sh tools include uapi: Grab a copy of linux/vhost.h 2017-08-01 13:04:56 -03:00
command-list.txt perf tools: Missing c2c command in command-list 2017-03-13 10:59:31 -03:00
CREDITS
design.txt
Makefile
Makefile.config perf tools: Robustify detection of clang binary 2017-08-28 16:44:46 -03:00
Makefile.perf perf trace beauty: Beautify pkey_{alloc,free,mprotect} arguments 2017-08-28 16:44:47 -03:00
MANIFEST tools include uapi: Grab a copy of linux/vhost.h 2017-08-01 13:04:56 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h perf tools: Use default CPUINFO_PROC where it fits 2017-08-17 16:58:21 -03:00
perf-with-kcore.sh
perf.c tools include: Adopt strstarts() from the kernel 2017-07-20 15:46:10 -03:00
perf.h perf tests attr: Add test_attr__ready function 2017-07-18 23:14:15 -03:00