perf stat: Make metric event lookup more robust
authorAndi Kleen <ak@linux.intel.com>
Mon, 24 Jun 2019 19:37:08 +0000 (12:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:14:15 +0000 (09:14 +0200)
commita64e018be77a15035862e68dcda120adf732d1ca
tree99c4a0b86d6eaa6a074295f5f5e3e561e3197a62
parent7343178ccf7db5533ecbecaf270a2dac9fbeb161
perf stat: Make metric event lookup more robust

[ Upstream commit 145c407c808352acd625be793396fd4f33c794f8 ]

After setting up metric groups through the event parser, the metricgroup
code looks them up again in the event list.

Make sure we only look up events that haven't been used by some other
metric. The data structures currently cannot handle more than one metric
per event. This avoids problems with multiple events partially
overlapping.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Link: http://lkml.kernel.org/r/20190624193711.35241-2-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/stat-shadow.c