Lines Matching refs:orig
399 * orig either gets freed and replaced with a new map, or reused
404 struct perf_cpu_map *perf_cpu_map__merge(struct perf_cpu_map *orig,
412 if (perf_cpu_map__is_subset(orig, other))
413 return orig;
414 if (perf_cpu_map__is_subset(other, orig)) {
415 perf_cpu_map__put(orig);
419 tmp_len = __perf_cpu_map__nr(orig) + __perf_cpu_map__nr(other);
426 while (i < __perf_cpu_map__nr(orig) && j < __perf_cpu_map__nr(other)) {
427 if (__perf_cpu_map__cpu(orig, i).cpu <= __perf_cpu_map__cpu(other, j).cpu) {
428 if (__perf_cpu_map__cpu(orig, i).cpu == __perf_cpu_map__cpu(other, j).cpu)
430 tmp_cpus[k++] = __perf_cpu_map__cpu(orig, i++);
435 while (i < __perf_cpu_map__nr(orig))
436 tmp_cpus[k++] = __perf_cpu_map__cpu(orig, i++);
444 perf_cpu_map__put(orig);
448 struct perf_cpu_map *perf_cpu_map__intersect(struct perf_cpu_map *orig,
456 if (perf_cpu_map__is_subset(other, orig))
457 return perf_cpu_map__get(orig);
458 if (perf_cpu_map__is_subset(orig, other))
461 tmp_len = max(__perf_cpu_map__nr(orig), __perf_cpu_map__nr(other));
467 while (i < __perf_cpu_map__nr(orig) && j < __perf_cpu_map__nr(other)) {
468 if (__perf_cpu_map__cpu(orig, i).cpu < __perf_cpu_map__cpu(other, j).cpu)
470 else if (__perf_cpu_map__cpu(orig, i).cpu > __perf_cpu_map__cpu(other, j).cpu)
474 tmp_cpus[k++] = __perf_cpu_map__cpu(orig, i++);