perf metrics: Sort the Default metricgroup
authorKan Liang <kan.liang@linux.intel.com>
Fri, 16 Jun 2023 03:14:16 +0000 (20:14 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Jun 2023 12:56:36 +0000 (09:56 -0300)
commit1c0e47956a8e1109ad9635b7fab3f2de515dd598
tree2daa9a31d56c6531cb1e34e0dcbb2163c551c24c
parent18b687d7ef90d1dd56c4df3be7365977861f5d82
perf metrics: Sort the Default metricgroup

The new default mode will print the metrics as a metric group. The
metrics from the same metric group must be adjacent to each other in the
metric list. But the metric_list_cmp() sorts metrics by the number of
events.

Add a new sort for the Default metricgroup, which sorts by
default_metricgroup_name and metric_name.

Add is_default in the struct metric_event to indicate that it's from
the Default metricgroup.

Store the displayed metricgroup name of the Default metricgroup into
the metric expr for output.

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ahmad Yasin <ahmad.yasin@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20230616031420.3751973-2-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/metricgroup.c
tools/perf/util/metricgroup.h