perf metrics: Fix SEGV with --for-each-cgroup
authorIan Rogers <irogers@google.com>
Fri, 5 May 2023 20:41:19 +0000 (13:41 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 5 May 2023 22:18:55 +0000 (19:18 -0300)
commit6c73f819b6b6d6f052e8dbe3f66f0693554ddf48
treefd60cb6403edf0748776195e1bf5c80cf61e8b68
parenta887466562b425bd6183bf75b523c1477c9fd22d
perf metrics: Fix SEGV with --for-each-cgroup

Ensure the metric threshold is copied correctly or else a use of
uninitialized memory happens.

Fixes: d0a3052f6faefffc ("perf metric: Compute and print threshold values")
Reported-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230505204119.3443491-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/metricgroup.c