linux/tools/perf
Namhyung Kim bacefe0c7b perf tools: Fixup module symbol end address properly
I got a strange error on ARM to fail on processing FINISHED_ROUND
record.  It turned out that it was failing in symbol__alloc_hist()
because the symbol size is too big.

When a sample is captured on a specific BPF program, it failed.  I've
added a debug code and found the end address of the symbol is from
the next module which is placed far way.

  ffff800008795778-ffff80000879d6d8: bpf_prog_1bac53b8aac4bc58_netcg_sock    [bpf]
  ffff80000879d6d8-ffff80000ad656b4: bpf_prog_76867454b5944e15_netcg_getsockopt      [bpf]
  ffff80000ad656b4-ffffd69b7af74048: bpf_prog_1d50286d2eb1be85_hn_egress     [bpf]   <---------- here
  ffffd69b7af74048-ffffd69b7af74048: $x.5    [sha3_generic]
  ffffd69b7af74048-ffffd69b7af740b8: crypto_sha3_init        [sha3_generic]
  ffffd69b7af740b8-ffffd69b7af741e0: crypto_sha3_update      [sha3_generic]

The logic in symbols__fixup_end() just uses curr->start to update the
prev->end.  But in this case, it won't work as it's too different.

I think ARM has a different kernel memory layout for modules and BPF
than on x86.  Actually there's a logic to handle kernel and module
boundary.  Let's do the same for symbols between different modules.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Leo Yan <leo.yan@linux.dev>
Cc: Will Deacon <will@kernel.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240212233322.1855161-1-namhyung@kernel.org
2024-02-16 16:07:28 -08:00
..
arch perf parse-regs: Introduce a weak function arch__sample_reg_masks() 2024-02-15 13:48:36 -08:00
bench libperf cpumap: Replace usage of perf_cpu_map__new(NULL) with perf_cpu_map__new_online_cpus() 2023-12-12 14:55:13 -03:00
dlfilters perf dlfilter: Add a test for object_code() 2023-09-30 00:09:06 -07:00
Documentation Merge branch 'perf-tools' into perf-tools-next 2024-02-12 12:19:21 -08:00
include/perf perf dlfilter: Add al_cleanup() 2023-08-15 16:41:49 -03:00
jvmti
pmu-events perf vendor events intel: Update tigerlake TMA metrics to 4.7 2024-02-16 15:29:11 -08:00
python
scripts perf scripts python arm-cs-trace-disasm.py: Do not ignore disam first sample 2023-12-20 14:31:59 -03:00
tests perf testsuite: Add test for kprobe handling 2024-02-16 11:49:47 -08:00
trace tools headers uapi: Sync linux/stat.h with the kernel sources to pick STATX_MNT_ID_UNIQUE 2024-01-26 10:51:48 -03:00
ui perf TUI: Don't ignore job control 2024-01-04 18:29:17 -03:00
util perf tools: Fixup module symbol end address properly 2024-02-16 16:07:28 -08:00
.gitignore perf build: Shellcheck support for OUTPUT directory 2023-12-05 15:46:43 -03:00
Build
builtin-annotate.c perf annotate: Add --insn-stat option for debugging 2023-12-23 22:40:17 -03:00
builtin-bench.c perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
builtin-buildid-cache.c perf buildid-cache: Fix use of uninitialized value 2023-10-12 10:01:56 -07:00
builtin-buildid-list.c
builtin-c2c.c perf mem: Clean up perf_pmus__num_mem_pmus() 2024-01-24 14:05:22 -08:00
builtin-config.c
builtin-daemon.c perf tools: Add missing else to cmd_daemon subcommand condition 2023-06-27 12:09:44 -07:00
builtin-data.c
builtin-diff.c perf diff: Replaces some ',' as separator with the more usual ';' 2023-07-20 11:43:45 -03:00
builtin-evlist.c
builtin-ftrace.c libperf cpumap: Replace usage of perf_cpu_map__new(NULL) with perf_cpu_map__new_online_cpus() 2023-12-12 14:55:13 -03:00
builtin-help.c
builtin-inject.c perf record: Lazy load kernel symbols 2023-11-09 13:49:32 -03:00
builtin-kallsyms.c perf symbol: Remove now unused symbol_conf.sort_by_name 2023-06-23 21:48:49 -07:00
builtin-kmem.c
builtin-kvm.c
builtin-kwork.c perf kwork: Fix a build error on 32-bit 2023-11-21 10:02:38 -08:00
builtin-list.c perf list: Add output file option 2024-01-26 10:51:49 -03:00
builtin-lock.c perf lock: Fix a memory leak on an error path 2023-11-27 10:21:27 -03:00
builtin-mem.c perf mem: Clean up perf_pmus__num_mem_pmus() 2024-01-24 14:05:22 -08:00
builtin-probe.c
builtin-record.c Merge branch 'perf-tools' into perf-tools-next 2024-02-12 12:19:21 -08:00
builtin-report.c perf tools: Make it possible to see perf's kernel and module memory mappings 2024-02-08 15:49:39 -08:00
builtin-sched.c perf sched: Move curr_pid and cpu_last_switched initialization to perf_sched__{lat|map|replay}() 2024-02-09 14:08:41 -08:00
builtin-script.c perf tools: Make it possible to see perf's kernel and module memory mappings 2024-02-08 15:49:39 -08:00
builtin-stat.c perf stat: Support per-cluster aggregation 2024-02-09 14:59:53 -08:00
builtin-timechart.c
builtin-top.c Merge branch 'perf-tools' into perf-tools-next 2024-02-12 12:19:21 -08:00
builtin-trace.c perf env: Introduce perf_env__arch_strerrno() 2023-12-04 16:42:09 -03:00
builtin-version.c perf version: Display availability of HAVE_DWARF_UNWIND_SUPPORT 2024-01-24 14:13:48 -08:00
builtin.h
check-headers.sh perf tools: Add get_unaligned_leNN() 2023-10-17 12:40:02 -07:00
command-list.txt
CREDITS
design.txt
Makefile
Makefile.config perf build: Cleanup perf register configuration 2024-02-15 13:48:55 -08:00
Makefile.perf perf testsuite: Install kprobe tests and common files 2024-02-16 11:50:02 -08:00
MANIFEST tools perf: Add arm64 sysreg files to MANIFEST 2023-11-22 11:17:53 -08:00
perf-archive.sh perf archive: Add new option '--unpack' to expand tarballs 2023-12-20 13:20:45 -03:00
perf-completion.sh perf shell completion: Support completion of metrics/metricgroups 2023-09-11 10:26:36 -03:00
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf tools: Add --debug-file option to redirect debug output 2023-11-28 14:14:53 -03:00
perf.h