linux/tools/perf
Ian Rogers bcb89e6320 perf ui hist: Add support for aggregated total_period and merging entries
Add the histogram side of hybrid event merging.

When events are merged the entries of the other events are linked to
the leader's entries as pairs, and a row is then displayed as the sum
over an entry and its pairs. Teach the hpp code to work on that sum:

 - The formatting and sorting routines add up the value of an entry and
   of each of its pairs, so a row shows, and is sorted by, the total
   across the core PMUs rather than the leader's value alone.
 - Percentages are taken against the summed total_period of the merged
   hists. Computing each event's share against its own PMU's total
   would leave the column not adding up to 100%.
   hist_entry__get_percent_limit_merged() does the same for
   --percent-limit, which would otherwise compare against the wrong
   total and filter out the wrong entries.
 - A header and column width are reserved for the "Total" the merged
   value is shown under.

evlist__merge_hists_hybrid() links the hists together and resorts the
result so that it is ordered by the merged total.

hists__link() is run once for every event merged into the leader, so an
entry can be offered as a pair more than once. hist_entry__add_pair()
used list_add_tail() unconditionally, which corrupts the list when the
entry is already on one. Return early if the entry is already paired
with this one, and use list_move_tail() so that an entry linked
elsewhere is moved rather than added a second time.

Merging is never combined with --hierarchy, which the merge_entries
tests rely on.

Signed-off-by: Ian Rogers <irogers@google.com>
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-09-18 17:28:52 -03:00
..
arch perf libdw: Fix Dwfl discovery with split files 2026-09-18 17:23:16 -03:00
bench perf bench messaging: Fix the formatting issue when printing. 2026-09-17 12:27:34 -03:00
check-header_ignore_hunks/lib
dlfilters
Documentation perf regs: Support x86 SIMD registers sampling 2026-09-14 15:34:05 -03:00
include/perf perf dso: Move build_id to dso_id 2025-07-25 10:37:56 -07:00
jvmti perf tools: Use calloc() where applicable 2026-04-08 19:21:05 -07:00
pmu-events perf jevents: Add mesh bandwidth saturation for CWF, EMR, GRR, SNR, SPR, SRF 2026-09-13 21:43:20 -03:00
python perf python: Fix ilist TreeNode string type drift 2026-09-13 18:39:12 -03:00
scripts tools: Port perf ui from GTK 2 to GTK 4 2026-09-09 17:00:04 -03:00
tests perf record: Fix unhandled POLLHUP on non_perf_event descriptors 2026-09-17 12:27:34 -03:00
trace perf trace: Introduce kernel symbol beautifier for virtual addresses 2026-09-04 18:14:01 -03:00
ui perf ui hist: Add support for aggregated total_period and merging entries 2026-09-18 17:28:52 -03:00
util perf ui hist: Add support for aggregated total_period and merging entries 2026-09-18 17:28:52 -03:00
.clang-format perf tool: Align structs in arrays in .clang-format 2026-09-09 17:03:35 -03: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 perf symbol: Fix ENOENT case for filename__read_build_id 2025-12-17 07:30:51 -08:00
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 perf tool: Add the perf_tool argument to all callbacks 2025-11-07 13:25:05 -08:00
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 perf machine: Explicitly pass in host perf_env 2025-07-25 10:37:57 -07:00
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 perf list: Avoid repeated strlen() when escaping JSON strings 2026-09-13 18:44:37 -03:00
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 perf tools: Add layout support for --symfs option 2026-03-10 23:13:30 -07:00
builtin-record.c perf record: Fix unhandled POLLHUP on non_perf_event descriptors 2026-09-17 12:27:34 -03: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 regs: Enable dumping of SIMD registers 2026-09-14 15:34:43 -03: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 perf check: Share the feature status printing routine with 'perf version' 2025-04-10 10:44:04 -03:00
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 perf tests: Improvements to build-test performance 2026-09-09 17:00:36 -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 tools: Fix arm64 source package build 2025-05-13 17:26:35 -03:00
perf-archive.sh tools/perf: Add --exclude-buildids option to perf archive command 2025-06-26 15:40:19 -07:00
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 perf: Completely remove possibility to override MAX_NR_CPUS 2025-09-12 10:52:22 -03:00