Skip to content

Commit 379c224

Browse files
captain5050acmel
authored andcommitted
perf stat: Correct check_per_pkg() cpu
Code was incorrectly using the cpu map index as the CPU. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Clarke <pc@us.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Riccardo Mancini <rickyman7@gmail.com> Cc: Stephane Eranian <eranian@google.com> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Vineet Singh <vineet.singh@intel.com> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-42-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent aa11e55 commit 379c224

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tools/perf/util/stat.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,12 @@ static bool pkg_id_equal(const void *__key1, const void *__key2,
292292
return *key1 == *key2;
293293
}
294294

295-
static int check_per_pkg(struct evsel *counter,
296-
struct perf_counts_values *vals, int cpu, bool *skip)
295+
static int check_per_pkg(struct evsel *counter, struct perf_counts_values *vals,
296+
int cpu_map_idx, bool *skip)
297297
{
298298
struct hashmap *mask = counter->per_pkg_mask;
299299
struct perf_cpu_map *cpus = evsel__cpus(counter);
300+
int cpu = perf_cpu_map__cpu(cpus, cpu_map_idx);
300301
int s, d, ret = 0;
301302
uint64_t *key;
302303

0 commit comments

Comments
 (0)