]> git.baikalelectronics.ru Git - kernel.git/commit
perf metric: Fix metric_leader
authorIan Rogers <irogers@google.com>
Sat, 15 Jan 2022 06:28:52 +0000 (22:28 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 15 Jan 2022 20:07:05 +0000 (17:07 -0300)
commited0d064ce624891b0c3f96c1406ced2194d3485b
treeeec8f94f1965b28da44b6c40ab0a32c6af610686
parent683a50ed75cc09bd80e373cca41b29a258997429
perf metric: Fix metric_leader

Multiple events may have a metric_leader to aggregate into.

This happens for uncore events where, for example, uncore_imc is
expanded into uncore_imc_0, uncore_imc_1, etc.

Such events all have the same metric_id and should aggregate into the
first event.

The change introducing metric_ids had a bug where the metric_id was
compared to itself, creating an always true condition.

Correct this by comparing the event in the metric_evlist and the
metric_leader.

Fixes: 9ac5e9c885191148 ("perf metric: Encode and use metric-id as qualifier")
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20220115062852.1959424-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/metricgroup.c