perf report/top: Add opt-in --hybrid-merge
Status from this message: Thanks, applied to perf-tools-next, for v7.4.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest9 patches 7 repliesApplied
- v39 patches 0 repliesSuperseded
- v29 patches 0 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 7 patches | 5 replies | Superseded |
Changes in v4 from the cover letter
- Patch 7: don't warn that there is nothing to merge when merging came from core.hybrid-merge rather than the command line. In v3, setting the config on a machine with a single core PMU made every perf report and perf top warn, which in the TUI is a popup that has to be dismissed. Track whether the option was given on the command line in symbol_conf so an explicit --hybrid-merge still warns, and document the difference.
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | perf evlist: Implement evlist__can_merge_hybrid using first_wildcard_matchtools/ tools/ tools/ +5 more | +236 | 0 replies | |
| 2/9 | perf ui hist: Add support for aggregated total_period and merging entriestools/ tools/ | +252 | 0 replies | |
| 3/9 | perf tools: Expose opt-in --hybrid-mergetools/ tools/ tools/ +2 more | +47 | 2 replies | |
| 4/9 | perf Documentation: Add tip for hybrid event mergingtools/ | +1 | 0 replies | |
| 5/9 | perf evlist: Toggle merged_hybrid_group properly in enable/disabletools/ | +26 | 0 replies | |
| 6/9 | perf tools: Add TUI hints for --hybrid-mergetools/ tools/ | +6 | 0 replies | |
| 7/9 | perf config: Add core.hybrid-merge to configure event mergingtools/ tools/ tools/ +2 more | +62 | 0 replies | |
| 8/9 | perf test: Expand tests for --hybrid-mergetools/ tools/ tools/ +3 more | +392 | 0 replies | |
| 9/9 | perf test: Isolate test suite from user .perfconfig nativelytools/ | +44 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/9] perf report/top: Add opt-in --hybrid-merge
On a hybrid machine a wildcard event expands to one event per core PMU, so "perf record -e cycles" records cpu_core/cycles/ and cpu_atom/cycles/. perf report and perf top then show one histogram per PMU, and a symbol that ran on both kinds of core is split across them, with each percentage relative to its own PMU's total. There is no way to ask for the single combined profile.
Add --hybrid-merge to perf report and perf top, which merges the histograms of the events that came from the same wildcard into one, with percentages taken against the summed period.
Merging is opt-in because it isn't always the right thing to do. The cores differ in performance, so a merged cycles count mixes work done at different rates and a merged IPC is not the IPC of either core type. perf-tips notes this. When merging is possible but wasn't asked for, the TUI says so, rather than merging silently.
core.hybrid-merge in .perfconfig turns it on by default. As a default rather than an explicit request it yields to the command line: with --hierarchy it is ignored with a warning, whereas asking for both --hierarchy and --hybrid-merge on the command line is an error. For the same reason it is silent when there is nothing to merge, so it doesn't warn on every invocation on a machine with a single core PMU.
perf stat is deliberately untouched. Counting already has its own merging options, and this is aimed at sampling.
The events to merge are found with first_wildcard_match, which parsing fills in. perf report reads events from a file rather than parsing them, so there the wildcard grouping is recovered by matching event names, and core PMUs are identified from the perf.data header topology so that a file recorded on another machine is read correctly.
Changes in v4:
- Patch 7: don't warn that there is nothing to merge when merging came from core.hybrid-merge rather than the command line. In v3, setting the config on a machine with a single core PMU made every perf report and perf top warn, which in the TUI is a popup that has to be dismissed. Track whether the option was given on the command line in symbol_conf so an explicit --hybrid-merge still warns, and document the difference.
Changes in v3:
- Patch 5: remove the redundant if (!pos->merged_hybrid_group) guard around the group member walk in __evlist__enable() and __evlist__disable(), and update the commit message. In v2, that guard claimed to skip walking the members of a merged leader, but merged_hybrid_group is only set on merged members (which have no group members to walk), never on the leader itself.
Changes in v2:
- The interactive 'M' keystroke that toggled merging in the hists browser is gone. Merging is now asked for on the command line or through core.hybrid-merge, and the browser instead points out that --hybrid-merge is available when there are events it could merge.
- Fold "perf ui hist: Format group headers iteratively based on proportional visual allocations" into patch 2, as the two only make sense together.
- New patch 5, so that enabling and disabling a merged set touches every event in it. The merged events are made members of a leader but are not a real group, so each still has to be toggled in its own right.
- New patch 7, adding core.hybrid-merge.
- New patch 9, so that "perf test" doesn't inherit the user's ~/.perfconfig. Without it, setting core.hybrid-merge breaks the output matching of unrelated shell tests.
- Patch 8 adds a C test for the merging decision and a report shell test, rather than only extending the perf top test.
- Rewrite the commit messages of patches 2, 3, 5 and 8 to describe the problem being solved rather than the diff.
Testing:
- New "Hybrid event merging" perf test with three subtests: merging events of 2 core PMUs, of 3 core PMUs, and events that must not be merged.
- New "perf report hybrid merge" shell test, and the perf top shell test extended.
- perf test 13, 17, 27, 30, 31, 66, 67, 68, 78, 102, 113 and 172 pass, covering the hists, --hierarchy and addr2line paths this touches.
- Builds in 13 configurations, and every patch builds on its own so the series stays bisectable.
Ian Rogers (9):
perf evlist: Implement evlist__can_merge_hybrid using
first_wildcard_match
perf ui hist: Add support for aggregated total_period and merging
entries
perf tools: Expose opt-in --hybrid-merge
perf Documentation: Add tip for hybrid event merging perf evlist: Toggle merged_hybrid_group properly in enable/disable perf tools: Add TUI hints for --hybrid-merge
perf config: Add core.hybrid-merge to configure event merging perf test: Expand tests for --hybrid-merge
perf test: Isolate test suite from user .perfconfig natively
tools/perf/Documentation/perf-config.txt | 10 + tools/perf/Documentation/perf-report.txt | 5 + tools/perf/Documentation/perf-top.txt | 5 + tools/perf/Documentation/tips.txt | 2 + tools/perf/builtin-report.c | 31 +++ tools/perf/builtin-top.c | 35 ++- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 50 +++- tools/perf/tests/hybrid-merge.c | 206 +++++++++++++++ tools/perf/tests/shell/report_hybrid_merge.sh | 121 +++++++++ tools/perf/tests/shell/top.sh | 73 +++++- tools/perf/tests/tests.h | 1 + tools/perf/ui/browsers/hists.c | 7 +- tools/perf/ui/hist.c | 246 +++++++++++++++++- tools/perf/util/config.c | 10 + tools/perf/util/evlist.c | 218 +++++++++++++++- tools/perf/util/evlist.h | 3 + tools/perf/util/evsel.h | 1 + tools/perf/util/hist.h | 15 +- tools/perf/util/parse-events.c | 4 +- tools/perf/util/pmu.c | 43 ++- tools/perf/util/pmu.h | 3 + tools/perf/util/symbol.c | 1 + tools/perf/util/symbol_conf.h | 3 + 24 files changed, 1054 insertions(+), 40 deletions(-) create mode 100644 tools/perf/tests/hybrid-merge.c create mode 100755 tools/perf/tests/shell/report_hybrid_merge.sh
base-commit: 91b0782fc9e9d2f0a40b5256146e014802fdbb36
prerequisite-patch-id: b6fdc526887b71fb66f5fe0c0d41f7ef9493861e
prerequisite-patch-id: d47077f674c700f4f6296e9367f7ddfe004aea89
prerequisite-patch-id: ed0db23450840601762fe85ca1bef06ce6d28fe7
prerequisite-patch-id: d84e6b96d533ee6ed549e26e94216e2da60f7f74
prerequisite-patch-id: 6e8f19551d771621a5037096626cfe7e271b36f9
prerequisite-patch-id: 3768dfd588c7439deb741bce44c74763011c6be7
prerequisite-patch-id: babac99a4faa3b1525e44d3f34ab33a88103334c
prerequisite-patch-id: 5279827453fea1536abc620aa33c887c44e41ee9
prerequisite-patch-id: bdc0d648a577142b9270fb59b54496bc2bf8d5ea
prerequisite-patch-id: f840408dcc3cc637a071f2540b31cc7b8d2ca146
prerequisite-patch-id: 8f4f390a5a60f62b61c6c9220e96bfce155fa233
prerequisite-patch-id: bc536fd240b5ddd999c781831a6445cb04ace25c
Signature · 1 line
2.55.0.1082.g2b9226bbc0-goog