projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
perf cpu_map: Add has() method
[cascardo/linux.git]
/
tools
/
perf
/
util
/
cpumap.c
diff --git
a/tools/perf/util/cpumap.c
b/tools/perf/util/cpumap.c
index
9bcf2be
..
02d8016
100644
(file)
--- a/
tools/perf/util/cpumap.c
+++ b/
tools/perf/util/cpumap.c
@@
-587,3
+587,15
@@
int cpu__setup_cpunode_map(void)
closedir(dir1);
return 0;
}
+
+bool cpu_map__has(struct cpu_map *cpus, int cpu)
+{
+ int i;
+
+ for (i = 0; i < cpus->nr; ++i) {
+ if (cpus->map[i] == cpu)
+ return true;
+ }
+
+ return false;
+}