linux/tools/perf
Matt Turner 0b568c865f perf tools: make the GTK4 report browser actually loadable at runtime
perf report --gtk dlopen()s libperf-gtk.so, which expects to resolve
symbols back against the running perf binary (callchain_param,
symbol_conf, evsel__name, and friends live in perf, not the plugin).
Two things broke that after the GTK 4 port:

perf never passed -rdynamic, so none of its symbols were in its
dynamic symbol table for a dlopen()ed plugin to find. Add -rdynamic to
LDFLAGS when GTK4 support is enabled.

annotated_source__hist_entry() was a static inline in annotate.h, so
ui/gtk/annotate.c calling it pulled hashmap__find()'s expansion,
hashmap_find(), into libperf-gtk.so as an undefined symbol. The only
hashmap_find perf links against normally is libbpf's internal one
(tools/lib/bpf/hashmap.c), built with -fvisibility=hidden, so it can
never be exported to a dlopen()ed plugin regardless of LDFLAGS. Move
annotated_source__hist_entry() into annotate.c as an ordinary exported
function, so the plugin depends on it the same way it already depends
on evsel__group_desc() and friends.

With both fixes, a default 'make GTK4=1' build (libbpf statically
linked) can dlopen() libperf-gtk.so and open the report browser without
NO_LIBBPF=1 or manual LDFLAGS. Verified with perf report --gtk against
real perf.data on a GTK4 desktop.

Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-09-09 17:00:36 -03:00
..
arch Merge remote-tracking branch 'torvalds/master' into perf-tools-next 2026-09-08 17:14:35 -03:00
bench perf bench futex: Define SYS_futex on 32-bit arches with 64-bit time_t 2026-09-08 17:50:39 -03:00
check-header_ignore_hunks/lib
dlfilters
Documentation tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
include/perf
jvmti perf tools: Use calloc() where applicable 2026-04-08 19:21:05 -07:00
pmu-events perf vendor events arm64: Fix Tegra410 Olympus event 0x0197 2026-08-18 14:31:18 -07:00
python perf python: Fix MetricGroup return type in perf.pyi 2026-08-09 22:02:41 -07:00
scripts tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
tests tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
trace perf trace: Introduce kernel symbol beautifier for virtual addresses 2026-09-04 18:14:01 -03:00
ui tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
util perf tools: make the GTK4 report browser actually loadable at runtime 2026-09-09 17:00:36 -03:00
.clang-format perf clang-format: Prioritize Python.h and expand other categories 2026-07-10 17:34:54 -07:00
.gitignore perf pmu-events: Split big_c_string storage into standalone compilation unit 2026-05-20 17:46:45 -03:00
bpf_skel.mak perf build: Compile BPF skeletons with -mcpu=v3 2026-06-04 10:58:32 -03:00
Build perf trace beauty: Make beauty generated C code standalone .o files 2026-05-20 17:46:45 -03:00
builtin-annotate.c tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
builtin-bench.c perf bench: Constify tables 2026-04-08 19:21:05 -07:00
builtin-buildid-cache.c
builtin-buildid-list.c perf build-id: Fix off-by-one bug when printing kernel/module build-id 2026-05-20 15:50:32 -03:00
builtin-c2c.c perf hist: Remove keysym.h include from hist.h 2026-09-08 17:50:37 -03:00
builtin-check.c perf data ctf: replace libbabeltrace with babeltrace2-ctf-writer 2026-06-04 17:34:52 -03:00
builtin-config.c perf tool: Tidy up util/cache.h header file users 2026-09-08 17:50:28 -03:00
builtin-daemon.c perf tools: Replace basename() calls with perf_basename() 2026-04-08 19:21:05 -07:00
builtin-data.c perf data ctf: replace libbabeltrace with babeltrace2-ctf-writer 2026-06-04 17:34:52 -03:00
builtin-diff.c perf tools: Guard test_bit from out-of-bounds sample CPU 2026-06-04 17:34:52 -03:00
builtin-evlist.c
builtin-ftrace.c perf ftrace latency: Do not read trace files when BPF is used 2026-09-08 18:04:33 -03:00
builtin-help.c perf tool: Tidy up util/cache.h header file users 2026-09-08 17:50:28 -03:00
builtin-inject.c perf python: Use evsel in sample in pyrf_event 2026-06-30 10:17:12 -07:00
builtin-kallsyms.c
builtin-kmem.c perf tools: Include file offset and event type name in skip messages 2026-06-03 16:31:03 -03:00
builtin-kvm.c perf hist: Remove keysym.h include from hist.h 2026-09-08 17:50:37 -03:00
builtin-kwork.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-list.c
builtin-lock.c perf evlist: Add reference count checking 2026-06-30 10:17:11 -07:00
builtin-mem.c perf tool: Remove evsel from tool APIs that pass the sample 2026-05-20 16:34:23 -03:00
builtin-probe.c
builtin-record.c perf tools: Fix sb_evlist leaks in top and record 2026-08-09 21:58:10 -07:00
builtin-report.c tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
builtin-sched.c perf sched latency: Add histogram and time interval options 2026-08-07 10:56:23 -07:00
builtin-script.c perf script: Fix metric_evlist leak in script_find_metrics 2026-08-09 21:58:10 -07:00
builtin-stat.c perf stat: Avoid uninitialized memory read on error 2026-09-09 08:10:17 -03:00
builtin-timechart.c perf timechart: Fix memory leaks in draw_wakeups() 2026-06-30 17:04:51 -07:00
builtin-top.c perf hist: Remove keysym.h include from hist.h 2026-09-08 17:50:37 -03:00
builtin-trace.c perf trace: Add upper bound checks for augmented BTF struct printing 2026-09-08 18:42:37 -03:00
builtin-version.c
builtin.h perf tool: Move usage strings and functions to perf.c 2026-09-08 17:50:32 -03:00
check-headers.sh perf beauty: Move copy of fadvise.h from tools/include/ to tools/perf/trace/beauty/include/ 2026-03-31 20:23:06 -07:00
CREDITS
design.txt
Makefile tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
Makefile.config perf tools: make the GTK4 report browser actually loadable at runtime 2026-09-09 17:00:36 -03:00
Makefile.perf tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf tool: Add fallback stubs for missing dependencies 2026-09-08 17:50:34 -03:00
perf.h