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?