linux-stable/tools
Arnaldo Carvalho de Melo c69bf11ad3 perf tools: Fix DSO filtering when not finding a map for a sampled address
When we lookup an address and don't find a map we should filter that
sample if the user specified a list of --dso entries to filter on, fix
it.

Before:

  $ perf script
             sleep 274800  2843.556162:          1 cycles:u:  ffffffffbb26bff4 [unknown] ([unknown])
             sleep 274800  2843.556168:          1 cycles:u:  ffffffffbb2b047d [unknown] ([unknown])
             sleep 274800  2843.556171:          1 cycles:u:  ffffffffbb2706b2 [unknown] ([unknown])
             sleep 274800  2843.556174:          6 cycles:u:  ffffffffbb2b0267 [unknown] ([unknown])
             sleep 274800  2843.556176:         59 cycles:u:  ffffffffbb2b03b1 [unknown] ([unknown])
             sleep 274800  2843.556180:        691 cycles:u:  ffffffffbb26bff4 [unknown] ([unknown])
             sleep 274800  2843.556189:       9160 cycles:u:      7fa9550eeaa3 __GI___tunables_init+0xf3 (/usr/lib64/ld-2.32.so)
             sleep 274800  2843.556312:      86937 cycles:u:      7fa9550e157b _dl_lookup_symbol_x+0x4b (/usr/lib64/ld-2.32.so)
  $

So we have some samples we somehow didn't find in a map for, if we now
do:

  $ perf report --stdio --dso /usr/lib64/ld-2.32.so
  # dso: /usr/lib64/ld-2.32.so
  #
  # Total Lost Samples: 0
  #
  # Samples: 8  of event 'cycles:u'
  # Event count (approx.): 96856
  #
  # Overhead  Command  Symbol
  # ........  .......  ........................
  #
      89.76%  sleep    [.] _dl_lookup_symbol_x
       9.46%  sleep    [.] __GI___tunables_init
       0.71%  sleep    [k] 0xffffffffbb26bff4
       0.06%  sleep    [k] 0xffffffffbb2b03b1
       0.01%  sleep    [k] 0xffffffffbb2b0267
       0.00%  sleep    [k] 0xffffffffbb2706b2
       0.00%  sleep    [k] 0xffffffffbb2b047d
  $

After this patch we get the right output with just entries for the DSOs
specified in --dso:

  $ perf report --stdio --dso /usr/lib64/ld-2.32.so
  # dso: /usr/lib64/ld-2.32.so
  #
  # Total Lost Samples: 0
  #
  # Samples: 8  of event 'cycles:u'
  # Event count (approx.): 96856
  #
  # Overhead  Command  Symbol
  # ........  .......  ........................
  #
      89.76%  sleep    [.] _dl_lookup_symbol_x
       9.46%  sleep    [.] __GI___tunables_init
  $
  #

Fixes: 96415e4d3f ("perf symbols: Avoid unnecessary symbol loading when dso list is specified")
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20210128131209.GD775562@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-02-03 13:10:43 -03:00
..
accounting
arch tools headers UAPI: Synch KVM's svm.h header with the kernel 2020-12-24 09:24:20 -03:00
bootconfig tools/bootconfig: Add tracing_on support to helper scripts 2021-01-14 10:32:20 -05:00
bpf Merge remote-tracking branch 'torvalds/master' into perf/core 2021-01-20 14:35:31 -03:00
build perf cs-etm: Update ARM's CoreSight hardware tracing OpenCSD library to v1.0.0 2021-01-20 14:34:20 -03:00
cgroup blk-iocost: update iocost_monitor.py 2020-09-01 19:38:33 -06:00
debugging docs: Update documentation to reflect what TAINT_CPU_OUT_OF_SPEC means 2020-12-08 10:53:58 -07:00
edid
firewire
firmware
gpio tools: gpio: fix %llu warning in gpio-watch.c 2021-01-18 10:05:35 +01:00
hv
iio
include Merge remote-tracking branch 'torvalds/master' into perf/core 2021-01-20 14:35:31 -03:00
io_uring tools/io_uring: fix compile breakage 2020-09-21 07:50:58 -06:00
kvm/kvm_stat tools/kvm_stat: Exempt time-based counters 2020-12-11 19:18:51 -05:00
laptop
leds
lib Merge remote-tracking branch 'torvalds/master' into perf/core 2021-01-27 16:48:04 -03:00
memory-model tools/memory-model: Label MP tests' producers and consumers 2020-11-06 17:25:17 -08:00
objtool objtool: Don't fail on missing symbol table 2021-01-21 15:49:58 -06:00
pci
pcmcia
perf perf tools: Fix DSO filtering when not finding a map for a sampled address 2021-02-03 13:10:43 -03:00
power tools/power/x86/intel-speed-select: Set higher of cpuinfo_max_freq or base_frequency 2021-01-04 15:54:27 +01:00
scripts perf build: Support build BPF skeletons with perf 2021-01-15 15:49:07 -03:00
spi
testing powerpc fixes for 5.11 #5 2021-01-24 09:40:51 -08:00
thermal/tmon
time
usb
virtio tools/virtio: add barrier for aarch64 2020-12-18 16:14:30 -05:00
vm mm: Add PG_arch_2 page flag 2020-09-04 12:46:06 +01:00
wmi
Makefile