linux-stable/tools
Jiri Olsa ce42bb1d2b perf symbols: Filter out hidden symbols from labels
[ Upstream commit 59a1770691 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-03-13 14:05:01 -07:00
..
accounting tools: move accounting tool from Documentation 2016-09-23 13:07:15 -06:00
arch x86/fpu: Finish excising 'eagerfpu' 2018-10-13 09:18:59 +02:00
build tools: build: Use HOSTLDFLAGS with fixdep 2018-08-24 13:12:39 +02:00
cgroup
firewire
gpio tools/gpio: Fix build error with musl libc 2018-02-03 17:05:34 +01:00
hv Tools: hv: Fix a bug in the key delete code 2018-09-26 08:36:35 +02:00
iio Second set of iio new device support, features and cleanups for the 4.9 cycle. 2016-09-14 20:42:03 +02:00
include perf/tools: header file sync up 2018-06-05 10:28:58 +02:00
kvm/kvm_stat
laptop tools: move laptops dslm tool from Documentation 2016-09-23 13:07:21 -06:00
lguest tools/lguest: Don't bork the terminal in case of wrong args 2016-09-08 08:05:24 +02:00
lib tools lib subcmd: Don't add the kernel sources to the include path 2019-01-26 09:38:35 +01:00
net
nfsd
objtool objtool: Fix segfault in .cold detection with -ffunction-sections 2018-12-17 09:38:32 +01:00
pcmcia tools: move pcmcia crc32hash tool from Documentation 2016-09-23 13:07:27 -06:00
perf perf symbols: Filter out hidden symbols from labels 2019-03-13 14:05:01 -07:00
power tools/power/cpupower: fix compilation with STATIC=true 2018-12-01 09:44:18 +01:00
scripts Kbuild: fix # escaping in .cmd files for future Make 2018-07-11 16:26:45 +02:00
spi Merge remote-tracking branches 'spi/topic/ti-qspi', 'spi/topic/tools', 'spi/topic/txx9' and 'spi/topic/xlp' into spi-next 2016-09-30 09:14:22 -07:00
testing selftests: netfilter: add simple masq/redirect test cases 2019-03-13 14:05:00 -07:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-05-30 07:50:43 +02:00
time
usb tools: usb: ffs-test: Fix build on big endian systems 2018-09-05 09:20:00 +02:00
virtio ptr_ring: fix up after recent ptr_ring changes 2018-11-10 07:42:50 -08:00
vm tools/vm/page-types.c: fix "defined but not used" warning 2018-10-10 08:53:20 +02:00
Makefile