diff options
Diffstat (limited to 'tools/perf/lib/cpumap.c')
-rw-r--r-- | tools/perf/lib/cpumap.c | 12 |
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) | |||
260 | 260 | ||
261 | return -1; | 261 | return -1; |
262 | } | 262 | } |
263 | |||
264 | int perf_cpu_map__max(struct perf_cpu_map *map) | ||
265 | { | ||
266 | int i, max = -1; | ||
267 | |||
268 | for (i = 0; i < map->nr; i++) { | ||
269 | if (map->map[i] > max) | ||
270 | max = map->map[i]; | ||
271 | } | ||
272 | |||
273 | return max; | ||
274 | } | ||