Lines Matching refs:orig
410 * orig either gets freed and replaced with a new map, or reused
415 struct perf_cpu_map *perf_cpu_map__merge(struct perf_cpu_map *orig,
423 if (perf_cpu_map__is_subset(orig, other))
424 return orig;
425 if (perf_cpu_map__is_subset(other, orig)) {
426 perf_cpu_map__put(orig);
430 tmp_len = __perf_cpu_map__nr(orig) + __perf_cpu_map__nr(other);
437 while (i < __perf_cpu_map__nr(orig) && j < __perf_cpu_map__nr(other)) {
438 if (__perf_cpu_map__cpu(orig, i).cpu <= __perf_cpu_map__cpu(other, j).cpu) {
439 if (__perf_cpu_map__cpu(orig, i).cpu == __perf_cpu_map__cpu(other, j).cpu)
441 tmp_cpus[k++] = __perf_cpu_map__cpu(orig, i++);
446 while (i < __perf_cpu_map__nr(orig))
447 tmp_cpus[k++] = __perf_cpu_map__cpu(orig, i++);
455 perf_cpu_map__put(orig);
459 struct perf_cpu_map *perf_cpu_map__intersect(struct perf_cpu_map *orig,
467 if (perf_cpu_map__is_subset(other, orig))
468 return perf_cpu_map__get(orig);
469 if (perf_cpu_map__is_subset(orig, other))
472 tmp_len = max(__perf_cpu_map__nr(orig), __perf_cpu_map__nr(other));
478 while (i < __perf_cpu_map__nr(orig) && j < __perf_cpu_map__nr(other)) {
479 if (__perf_cpu_map__cpu(orig, i).cpu < __perf_cpu_map__cpu(other, j).cpu)
481 else if (__perf_cpu_map__cpu(orig, i).cpu > __perf_cpu_map__cpu(other, j).cpu)
485 tmp_cpus[k++] = __perf_cpu_map__cpu(orig, i++);