Re: [RFC PATCH 1/1] perf arm64: Implement --topdown with metrics
From: Andrew Kilroy
Date: Wed Jan 05 2022 - 12:00:16 EST
On 17/12/2021 10:19, John Garry wrote:
And there is no colouring for results which are above/below standard
thresholds (see stat-shadow.c:get_radio_color()).
My impression is that we're not plugging the results from
metricgroup__parse_groups_to_evlist() into the --topdown print
functionality properly.
The --topdown kernel event colouring is dictated by a large if-else
statement in stat-shadow.c:perf_stat__print_shadow_stats.
There are branches depending on what is returned by
perf_stat_evsel__is() for example
} else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_BUBBLES)) {
double fe_bound = td_fe_bound(cpu, st, &rsd);
if (fe_bound > 0.2)
color = PERF_COLOR_RED;
print_metric(config, ctxp, color, "%8.1f%%", "frontend bound",
fe_bound * 100.);
} else if (perf_stat_evsel__is(evsel, TOPDOWN_SLOTS_RETIRED)) {
Because the patches are enabling metrics (equivalent of the -M
'somemetricname' option), the perf_stat__print_shadow_stats function
always makes calls to generic_metric(), where colours are never picked.
Seeing thresholds like:
retiring > 0.7
fe_bound > 0.2
be_bound > 0.2
bad_spec > 0.1
I'm not sure about adding the colouring really. Are these thresholds
x86 specific?
Thanks,
John
Andrew