summaryrefslogtreecommitdiffstats
path: root/tools/perf/lib/cpumap.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/lib/cpumap.c')
-rw-r--r--tools/perf/lib/cpumap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/lib/cpumap.c b/tools/perf/lib/cpumap.c
index 1f0e6f334237..2ca1fafa620d 100644
--- a/tools/perf/lib/cpumap.c
+++ b/tools/perf/lib/cpumap.c
@@ -260,3 +260,15 @@ int perf_cpu_map__idx(struct perf_cpu_map *cpus, int cpu)
return -1;
}
+
+int perf_cpu_map__max(struct perf_cpu_map *map)
+{
+ int i, max = -1;
+
+ for (i = 0; i < map->nr; i++) {
+ if (map->map[i] > max)
+ max = map->map[i];
+ }
+
+ return max;
+}