diff options
| author | Namhyung Kim <namhyung@kernel.org> | 2025-03-31 00:37:20 -0700 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-04-25 12:31:51 -0300 |
| commit | b09124e2e167e1ec4e29fe4c12f8956c43822ffd (patch) | |
| tree | 5b450e56e9ddd65596635875f0ad919dc7fc54de /tools/perf/ui | |
| parent | dbd11b6bdab12f60fa99f0d9ab6b626ea86be9f8 (diff) | |
perf hist: Remove formats in hierarchy when cancel latency
Likewise, it should remove latency output fields in hierarchy list.
Pass evlist to perf_hpp__cancel_latency() to handle them properly.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250331073722.4695-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
| -rw-r--r-- | tools/perf/ui/hist.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 1d3f944ed35e..3ffce69fc823 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -739,9 +739,10 @@ void perf_hpp__cancel_cumulate(struct evlist *evlist) } } -void perf_hpp__cancel_latency(void) +void perf_hpp__cancel_latency(struct evlist *evlist) { struct perf_hpp_fmt *fmt, *lat, *acc, *tmp; + struct evsel *evsel; if (is_strict_order(field_order)) return; @@ -755,6 +756,18 @@ void perf_hpp__cancel_latency(void) if (fmt_equal(lat, fmt) || fmt_equal(acc, fmt)) perf_hpp__column_unregister(fmt); } + + evlist__for_each_entry(evlist, evsel) { + struct hists *hists = evsel__hists(evsel); + struct perf_hpp_list_node *node; + + list_for_each_entry(node, &hists->hpp_formats, list) { + perf_hpp_list__for_each_format_safe(&node->hpp, fmt, tmp) { + if (fmt_equal(lat, fmt) || fmt_equal(acc, fmt)) + perf_hpp__column_unregister(fmt); + } + } + } } void perf_hpp__setup_output_field(struct perf_hpp_list *list) |
