linux/tools/perf/util
Jiri Olsa 59a1770691 perf symbols: Filter out hidden symbols from labels
When perf is built with the annobin plugin (RHEL8 build) extra symbols
are added to its binary:

  # nm perf | grep annobin | head -10
  0000000000241100 t .annobin_annotate.c
  0000000000326490 t .annobin_annotate.c
  0000000000249255 t .annobin_annotate.c_end
  00000000003283a8 t .annobin_annotate.c_end
  00000000001bce18 t .annobin_annotate.c_end.hot
  00000000001bce18 t .annobin_annotate.c_end.hot
  00000000001bc3e2 t .annobin_annotate.c_end.unlikely
  00000000001bc400 t .annobin_annotate.c_end.unlikely
  00000000001bce18 t .annobin_annotate.c.hot
  00000000001bce18 t .annobin_annotate.c.hot
  ...

Those symbols have no use for report or annotation and should be
skipped.  Moreover they interfere with the DWARF unwind test on the PPC
arch, where they are mixed with checked symbols and then the test fails:

  # perf test dwarf -v
  59: Test dwarf unwind                                     :
  --- start ---
  test child forked, pid 8515
  unwind: .annobin_dwarf_unwind.c:ip = 0x10dba40dc (0x2740dc)
  ...
  got: .annobin_dwarf_unwind.c 0x10dba40dc, expecting test__arch_unwind_sample
  unwind: failed with 'no error'

The annobin symbols are defined as NOTYPE/LOCAL/HIDDEN:

  # readelf -s ./perf | grep annobin | head -1
    40: 00000000001bce4f     0 NOTYPE  LOCAL  HIDDEN    13 .annobin_init.c

They can still pass the check for the label symbol. Adding check for
HIDDEN and INTERNAL (as suggested by Nick below) visibility and filter
out such symbols.

>   Just to be awkward, if you are going to ignore STV_HIDDEN
>   symbols then you should probably also ignore STV_INTERNAL ones
>   as well...  Annobin does not generate them, but you never know,
>   one day some other tool might create some.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nick Clifton <nickc@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190128133526.GD15461@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-02-04 15:50:38 -03:00
..
c++ perf clang: Do not use 'return std::move(something)' 2019-02-04 11:32:34 -03:00
cs-etm-decoder perf cs-etm: Generate branch sample for exception packet 2018-12-18 12:24:00 -03:00
include Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
intel-pt-decoder perf script: Fix LBR skid dump problems in brstackinsn 2018-12-28 16:33:02 -03:00
libunwind
scripting-engines tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
annotate.c perf annotate: Pass filename to objdump via execl 2019-01-04 12:54:49 -03:00
annotate.h perf annotate: Compute average IPC and IPC coverage per symbol 2018-12-17 14:55:32 -03:00
arm-spe-pkt-decoder.c
arm-spe-pkt-decoder.h
arm-spe.c
arm-spe.h
auxtrace.c perf auxtrace: Alter addr_filter__entire_dso() to work if there are no symbols 2018-12-18 12:21:44 -03:00
auxtrace.h perf script: Make itrace script default to all calls 2018-10-24 15:29:54 -03:00
block-range.c
block-range.h
bpf-loader.c perf bpf-loader: Fix debugging message typo 2018-12-17 14:56:39 -03:00
bpf-loader.h perf bpf: Make bpf__setup_output_event() return the bpf-output event 2018-08-08 15:55:58 -03:00
bpf-prologue.c docs: Fix some broken references 2018-06-15 18:10:01 -03:00
bpf-prologue.h
branch.c
branch.h
Build perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
build-id.c perf thread: Make thread__find_map() return the map 2018-04-26 13:47:08 -03:00
build-id.h
cache.h
call-path.c
call-path.h
callchain.c perf report: Fix wrong iteration count in --branch-history 2019-01-04 12:54:49 -03:00
callchain.h perf report: Fix wrong iteration count in --branch-history 2019-01-04 12:54:49 -03:00
cgroup.c perf cgroup: Make evlist__find_cgroup() more compact 2018-06-04 10:28:50 -03:00
cgroup.h
cloexec.c
cloexec.h
color.c
color.h
comm.c perf tools: Fix struct comm_str removal crash 2018-07-24 14:54:03 -03:00
comm.h
compress.h perf tools: Add is_compressed callback to compressions array 2018-08-20 08:54:59 -03:00
config.c perf config: Modify size factor of snprintf 2018-12-17 14:59:40 -03:00
config.h perf config: Call perf_config__init() lazily 2018-05-16 16:11:09 -03:00
counts.c
counts.h
cpumap.c perf tools: Handle TOPOLOGY headers with no CPU 2019-01-21 11:28:56 -03:00
cpumap.h
cs-etm.c perf cs-etm: Generate branch sample for exception packet 2018-12-18 12:24:00 -03:00
cs-etm.h coresight: Move to SPDX identifier 2018-04-19 12:29:41 -03:00
ctype.c
data-convert-bt.c tools lib traceevent, perf tools: Rename enum format_flags to enum tep_format_flags 2018-09-19 17:14:13 -03:00
data-convert-bt.h
data-convert.h
data.c
data.h
db-export.c perf db-export: Add trace begin / end branch type variants 2018-09-20 11:10:25 -03:00
db-export.h
debug.c perf debug: Avoid setting 'quiet' to 'true' unnecessarily 2018-03-16 16:39:02 -03:00
debug.h
demangle-java.c
demangle-java.h
demangle-rust.c
demangle-rust.h
drv_configs.c
drv_configs.h
dso.c perf dso: Export data_file_size() method there are no symbols 2018-12-18 12:21:44 -03:00
dso.h perf dso: Export data_file_size() method there are no symbols 2018-12-18 12:21:44 -03:00
dump-insn.c perf script: Fix LBR skid dump problems in brstackinsn 2018-12-28 16:33:02 -03:00
dump-insn.h perf script: Fix LBR skid dump problems in brstackinsn 2018-12-28 16:33:02 -03:00
dwarf-aux.c perf config: Rename to HAVE_DWARF_GETLOCATIONS_SUPPORT 2018-04-02 13:50:24 -03:00
dwarf-aux.h
dwarf-regs.c
env.c perf env: Also consider env->arch == NULL as local operation 2018-12-17 14:54:02 -03:00
env.h perf record: Encode -k clockid frequency into Perf trace 2018-10-18 11:16:38 -03:00
event.c perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
event.h perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
evlist.c perf tools: Add missing sigqueue() prototype for systems lacking it 2018-12-18 12:23:56 -03:00
evlist.h perf record: Enable asynchronous trace writing 2018-12-17 14:55:08 -03:00
evsel_fprintf.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
evsel.c perf tools: Fix crash on synthesizing the unit 2018-11-12 08:37:49 -08:00
evsel.h tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
expr.h
expr.y
find-map.c perf tools: Make find_vdso_map() more modular 2019-01-08 13:28:13 -03:00
genelf_debug.c
genelf.c perf tools: Fix spelling mistake: "builid" -> "buildid" 2018-04-30 12:02:03 -03:00
genelf.h perf jitdump: Add Sparc support. 2018-10-18 11:16:38 -03:00
generate-cmdlist.sh perf tools: Rename HAVE_SYSCALL_TABLE to HAVE_SYSCALL_TABLE_SUPPORT 2018-04-12 10:33:31 -03:00
get_current_dir_name.c tools build feature: Check if get_current_dir_name() is available 2018-11-19 12:12:17 -08:00
group.h
header.c perf header: Fix up argument to ctime() 2018-12-18 12:23:56 -03:00
header.h perf record: Encode -k clockid frequency into Perf trace 2018-10-18 11:16:38 -03:00
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
hist.h perf report: Display average IPC and IPC coverage per symbol 2018-12-17 14:55:44 -03:00
intel-bts.c perf thread-stack: Fix thread stack processing for the idle task 2019-01-02 11:03:17 -03:00
intel-bts.h
intel-pt.c perf thread-stack: Fix thread stack processing for the idle task 2019-01-02 11:03:17 -03:00
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c perf bpf: Give precedence to bpf header dir 2018-08-30 15:52:20 -03:00
llvm-utils.h perf llvm: Allow passing options to llc in addition to clang 2018-08-20 08:54:58 -03:00
lzma.c perf tools: Add lzma_is_compressed function 2018-08-20 08:54:59 -03:00
machine.c perf report: Fix wrong iteration count in --branch-history 2019-01-04 12:54:49 -03:00
machine.h perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
map.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
map.h perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
mem2node.c
mem2node.h
mem-events.c perf mem/c2c: Fix perf_mem_events to support powerpc 2019-02-04 11:32:14 -03:00
mem-events.h
memswap.c
memswap.h
metricgroup.c perf list: Unify metric group description format with PMU event description 2018-07-31 11:35:44 -03:00
metricgroup.h perf stat: Add transaction flag (-T) support for s390 2018-07-24 14:49:37 -03:00
mmap.c perf record: Fix memory leak on AIO objects deallocation 2018-12-17 14:59:34 -03:00
mmap.h perf record: Extend trace writing to multi AIO 2018-12-17 14:55:11 -03:00
namespaces.c perf tools: Restore proper cwd on return from mnt namespace 2018-11-19 12:12:26 -08:00
namespaces.h perf tools: Restore proper cwd on return from mnt namespace 2018-11-19 12:12:26 -08:00
ordered-events.c perf ordered_events: Fix crash in ordered_events__free 2019-01-17 11:07:00 -03:00
ordered-events.h perf ordered_events: Add first_time() method 2018-12-17 15:02:17 -03:00
parse-branch-options.c
parse-branch-options.h
parse-events.c perf parse-events: Fix unchecked usage of strncpy() 2018-12-17 14:59:30 -03:00
parse-events.h perf evsel: Introduce per event max_events property 2018-10-19 16:31:09 -03:00
parse-events.l perf evsel: Introduce per event max_events property 2018-10-19 16:31:09 -03:00
parse-events.y perf tools: Fix error index for pmu event parser 2018-06-07 15:50:14 -03:00
parse-regs-options.c
parse-regs-options.h
path.c
path.h
perf_regs.c
perf_regs.h
perf-hooks-list.h
perf-hooks.c
perf-hooks.h
PERF-VERSION-GEN
pmu.c perf pmu: Move *_cpuid_str() weak functions to header.c 2018-11-21 22:39:59 -03:00
pmu.h
pmu.l
pmu.y
print_binary.c
print_binary.h
probe-event.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
probe-event.h perf probe: Support SDT markers having reference counter (semaphore) 2018-09-24 04:44:54 -04:00
probe-file.c perf probe: Fix unchecked usage of strncpy() 2018-12-17 14:59:28 -03:00
probe-file.h perf probe: Support SDT markers having reference counter (semaphore) 2018-09-24 04:44:54 -04:00
probe-finder.c perf probe: Use right type to access array elements 2018-03-19 13:51:53 -03:00
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c perf python: Do not force closing original perf descriptor in evlist.get_pollfd() 2018-12-28 16:33:02 -03:00
rb_resort.h
rblist.c
rblist.h
record.c
rwsem.c
rwsem.h
s390-cpumsf-kernel.h perf report: Add raw report support for s390 auxiliary trace 2018-08-08 15:26:48 -03:00
s390-cpumsf.c perf tools: Cast off_t to s64 to avoid warning on bionic libc 2018-12-18 12:23:57 -03:00
s390-cpumsf.h perf auxtrace: Support for perf report -D for s390 2018-08-03 10:34:18 -03:00
sane_ctype.h
session.c perf session: Add comment for perf_session__register_idle_thread() 2019-01-02 11:05:06 -03:00
session.h perf tools: Remove perf_tool from event_op2 2018-09-19 10:25:10 -03:00
setns.c
setup.py perf python: Remove -fstack-clash-protection when building with some clang versions 2019-01-18 11:38:09 -03:00
smt.c
smt.h
sort.c perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
sort.h perf report: Display average IPC and IPC coverage per symbol 2018-12-17 14:55:44 -03:00
srccode.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
srccode.h perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
srcline.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
srcline.h perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
stat-display.c perf stat: Fix CSV mode column output for non-cgroup events 2018-12-17 14:53:41 -03:00
stat-shadow.c perf stat: Fix shadow stats for clock events 2018-12-17 14:53:30 -03:00
stat.c perf tools: Remove perf_tool from event_op2 2018-09-19 10:25:10 -03:00
stat.h perf tools: Remove perf_tool from event_op2 2018-09-19 10:25:10 -03:00
strbuf.c perf strbuf: Remove redundant va_end() in strbuf_addv() 2019-01-04 12:54:49 -03:00
strbuf.h
strfilter.c
strfilter.h
string2.h
string.c
strlist.c
strlist.h
svghelper.c perf svghelper: Fix unchecked usage of strncpy() 2018-12-17 14:59:20 -03:00
svghelper.h
symbol_fprintf.c perf symbols: Unify symbol maps 2018-04-27 10:47:06 -03:00
symbol-elf.c perf symbols: Filter out hidden symbols from labels 2019-02-04 15:50:38 -03:00
symbol-minimal.c perf symbols: Unify symbol maps 2018-04-27 10:47:06 -03:00
symbol.c perf symbols: Add 'arch_cpu_idle' to the list of kernel idle symbols 2019-01-09 16:21:15 -03:00
symbol.h perf annotate: Create a annotate2 flag in struct symbol 2018-12-17 14:55:40 -03:00
syscalltbl.c perf trace arm64: Use generated syscall table 2018-07-24 14:53:01 -03:00
syscalltbl.h
target.c
target.h
term.c
term.h
thread_map.c
thread_map.h
thread-stack.c perf thread-stack: Fix thread stack processing for the idle task 2019-01-02 11:03:17 -03:00
thread-stack.h perf thread-stack: Fix thread stack processing for the idle task 2019-01-02 11:03:17 -03:00
thread.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
thread.h perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
time-utils.c
time-utils.h
tool.h perf tools: Remove perf_tool from event_op3 2018-09-19 10:25:10 -03:00
top.c perf top: Move perf_top__reset_sample_counters() to after counts display 2018-12-17 14:58:47 -03:00
top.h perf top: Save and display the drop count stats 2018-12-17 14:58:33 -03:00
trace-event-info.c perf tools: Cleanup trace-event-info 'tdata' leak 2018-10-08 14:23:45 -03:00
trace-event-parse.c tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
trace-event-read.c perf tools: traceevent API cleanup, remove __tep_data2host*() 2018-12-17 14:56:08 -03:00
trace-event-scripting.c tools lib traceevent, perf tools: Rename struct pevent to struct tep_handle 2018-08-10 15:29:35 -03:00
trace-event.c tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
trace-event.h tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' 2018-12-17 14:56:02 -03:00
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c perf unwind: Take pgoff into account when reporting elf to libdwfl 2018-10-31 09:57:50 -03:00
unwind-libdw.h
unwind-libunwind-local.c perf script: Show correct offsets for DWARF-based unwinding 2018-07-24 14:53:11 -03:00
unwind-libunwind.c
unwind.h
usage.c
util-cxx.h
util.c perf util: Make copyfile_offset() global 2018-09-19 10:25:12 -03:00
util.h tools build feature: Check if get_current_dir_name() is available 2018-11-19 12:12:17 -08:00
values.c
values.h
vdso.c perf tools: Make find_vdso_map() more modular 2019-01-08 13:28:13 -03:00
vdso.h
xyarray.c
xyarray.h
zlib.c perf tools: Add gzip_is_compressed function 2018-08-20 08:54:59 -03:00