The patch which fixes "ARM PMUs cpu maps having offline cpus" depends on an older patch includes an introduction of struct perf_cpu, which is a wrap of single int- typed cpu. The related modification is beyond the bugfix target of the original patch, so I reverted the presence of struct perf_cpu.
Signed-off-by: Yushan Wang wangyushan12@huawei.com --- tools/lib/perf/cpumap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/lib/perf/cpumap.c b/tools/lib/perf/cpumap.c index 7ffa055c32e0..8546ea09029c 100644 --- a/tools/lib/perf/cpumap.c +++ b/tools/lib/perf/cpumap.c @@ -296,9 +296,9 @@ bool perf_cpu_map__is_subset(const struct perf_cpu_map *a, const struct perf_cpu return false;
for (int i = 0, j = 0; i < a->nr; i++) { - if (a->map[i].cpu > b->map[j].cpu) + if (a->map[i] > b->map[j]) return false; - if (a->map[i].cpu == b->map[j].cpu) { + if (a->map[i] == b->map[j]) { j++; if (j == b->nr) return true; @@ -367,7 +367,7 @@ struct perf_cpu_map *perf_cpu_map__merge(struct perf_cpu_map *orig, struct perf_cpu_map *perf_cpu_map__intersect(struct perf_cpu_map *orig, struct perf_cpu_map *other) { - struct perf_cpu *tmp_cpus; + int *tmp_cpus; int tmp_len; int i, j, k; struct perf_cpu_map *merged = NULL; @@ -378,15 +378,15 @@ struct perf_cpu_map *perf_cpu_map__intersect(struct perf_cpu_map *orig, return perf_cpu_map__get(other);
tmp_len = max(orig->nr, other->nr); - tmp_cpus = malloc(tmp_len * sizeof(struct perf_cpu)); + tmp_cpus = malloc(tmp_len * sizeof(int)); if (!tmp_cpus) return NULL;
i = j = k = 0; while (i < orig->nr && j < other->nr) { - if (orig->map[i].cpu < other->map[j].cpu) + if (orig->map[i] < other->map[j]) i++; - else if (orig->map[i].cpu > other->map[j].cpu) + else if (orig->map[i] > other->map[j]) j++; else { j++;