summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/metricgroup.c
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2023-06-15 06:53:10 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-06-15 22:16:48 -0300
commitb0a9e8f81fc45e6d3c9ddf290dabd7f4610f2939 (patch)
tree38918a4db8f1e3f8999335bc0f768e33d622d145 /tools/perf/util/metricgroup.c
parent969a4661440808a820361c25a59d59cd9d3a9978 (diff)
downloadlinux-b0a9e8f81fc45e6d3c9ddf290dabd7f4610f2939.tar.gz
linux-b0a9e8f81fc45e6d3c9ddf290dabd7f4610f2939.tar.bz2
linux-b0a9e8f81fc45e6d3c9ddf290dabd7f4610f2939.zip
perf stat,jevents: Introduce Default tags for the default mode
Introduce a new metricgroup, Default, to tag all the metric groups which will be collected in the default mode. Add a new field, DefaultMetricgroupName, in the JSON file to indicate the real metric group name. It will be printed in the default output to replace the event names. There is nothing changed for the output format. On SPR, both TopdownL1 and TopdownL2 are displayed in the default output. On ARM, Intel ICL and later platforms (before SPR), only TopdownL1 is displayed in the default output. Suggested-by: Stephane Eranian <eranian@google.com> 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> Link: https://lore.kernel.org/r/20230615135315.3662428-4-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/metricgroup.c')
-rw-r--r--tools/perf/util/metricgroup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index 74f2d8efc02d..8b19644ade7d 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -137,6 +137,11 @@ struct metric {
* output.
*/
const char *metric_unit;
+ /**
+ * Optional name of the metric group reported
+ * if the Default metric group is being processed.
+ */
+ const char *default_metricgroup_name;
/** Optional null terminated array of referenced metrics. */
struct metric_ref *metric_refs;
/**
@@ -219,6 +224,7 @@ static struct metric *metric__new(const struct pmu_metric *pm,
m->pmu = pm->pmu ?: "cpu";
m->metric_name = pm->metric_name;
+ m->default_metricgroup_name = pm->default_metricgroup_name;
m->modifier = NULL;
if (modifier) {
m->modifier = strdup(modifier);