linux-stable/tools/perf
Ian Rogers cc53477d89 perf symbol: Fail to read phdr workaround
[ Upstream commit 6d518ac7be ]

The perf jvmti agent doesn't create program headers, in this case
fallback on section headers as happened previously.

Committer notes:

To test this, from a public post by Ian:

1) download a Java workload dacapo-9.12-MR1-bach.jar from
https://sourceforge.net/projects/dacapobench/

2) build perf such as "make -C tools/perf O=/tmp/perf NO_LIBBFD=1" it
should detect Java and create /tmp/perf/libperf-jvmti.so

3) run perf with the jvmti agent:

  perf record -k 1 java -agentpath:/tmp/perf/libperf-jvmti.so -jar dacapo-9.12-MR1-bach.jar -n 10 fop

4) run perf inject:

  perf inject -i perf.data -o perf-injected.data -j

5) run perf report

  perf report -i perf-injected.data | grep org.apache.fop

With this patch reverted I see lots of symbols like:

     0.00%  java             jitted-388040-4656.so  [.] org.apache.fop.fo.FObj.bind(org.apache.fop.fo.PropertyList)

With the patch (2d86612aac ("perf symbol: Correct address for bss
symbols")) I see lots of:

  dso__load_sym_internal: failed to find program header for symbol:
  Lorg/apache/fop/fo/FObj;bind(Lorg/apache/fop/fo/PropertyList;)V
  st_value: 0x40

Fixes: 2d86612aac ("perf symbol: Correct address for bss symbols")
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Leo Yan <leo.yan@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20220731164923.691193-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-25 11:18:07 +02:00
..
arch
bench perf bench numa: Address compiler error on s390 2022-05-25 09:14:37 +02:00
Documentation
examples/bpf
include/bpf
jvmti
lib
pmu-events perf jevents: Fix event syntax error caused by ExtSel 2022-06-14 18:11:44 +02:00
python tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
scripts perf scripts python: exported-sql-viewer.py: Fix warning display 2021-06-03 08:59:00 +02:00
tests perf tests: Remove bash construct from record+zstd_comp_decomp.sh 2021-11-26 10:47:18 +01:00
trace perf beauty: Fix fsconfig generator 2021-05-14 09:44:30 +02:00
ui perf hist: Fix memory leak of a perf_hpp_fmt 2021-12-08 09:01:10 +01:00
util perf symbol: Fail to read phdr workaround 2022-08-25 11:18:07 +02:00
.gitignore
Build
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c perf c2c: Fix sorting in percent_rmt_hitm_cmp() 2022-06-14 18:11:56 +02:00
builtin-config.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c perf ftrace: Fix access to pid in array when setting a pid filter 2021-05-07 10:51:37 +02:00
builtin-help.c
builtin-inject.c perf inject: Close inject.output on exit 2021-07-28 13:31:02 +02:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-list.c
builtin-lock.c perf lock: Don't free "lock_seq_stat" if read_count isn't zero 2020-11-24 13:29:05 +01:00
builtin-mem.c
builtin-probe.c
builtin-record.c
builtin-report.c perf report: Fix memory leaks around perf_tip() 2021-12-08 09:01:10 +01:00
builtin-sched.c
builtin-script.c perf script: Fix CPU filtering of a script's switch events 2022-01-05 12:37:46 +01:00
builtin-stat.c
builtin-timechart.c
builtin-top.c
builtin-trace.c
builtin-version.c
builtin.h
check-headers.sh x86: xen: insn: Decode Xen and KVM emulate-prefix signature 2022-05-15 19:54:47 +02:00
command-list.txt
CREDITS
design.txt
Makefile
Makefile.config tools build: Filter out options and warnings not supported by clang 2022-04-15 14:18:40 +02:00
Makefile.perf tools: Factor HOSTCC, HOSTLD, HOSTAR definitions 2021-01-30 13:54:10 +01:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Fix perf's libperf_print callback 2022-04-15 14:18:38 +02:00
perf.h