We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3ad8d2 commit da0bfb9Copy full SHA for da0bfb9
tools/lib/perf/cpumap.c
@@ -355,17 +355,12 @@ struct perf_cpu_map *perf_cpu_map__merge(struct perf_cpu_map *orig,
355
int i, j, k;
356
struct perf_cpu_map *merged;
357
358
- if (!orig && !other)
359
- return NULL;
360
- if (!orig) {
361
- perf_cpu_map__get(other);
362
- return other;
363
- }
364
- if (!other)
365
- return orig;
366
- if (orig->nr == other->nr &&
367
- !memcmp(orig->map, other->map, orig->nr * sizeof(struct perf_cpu)))
+ if (perf_cpu_map__is_subset(orig, other))
368
return orig;
+ if (perf_cpu_map__is_subset(other, orig)) {
+ perf_cpu_map__put(orig);
+ return perf_cpu_map__get(other);
+ }
369
370
tmp_len = orig->nr + other->nr;
371
tmp_cpus = malloc(tmp_len * sizeof(struct perf_cpu));
0 commit comments