projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
perf: builtin-record: Document and check that mmap_pages must be a power of two.
[linux-2.6-block.git]
/
tools
/
perf
/
util
/
evlist.c
diff --git
a/tools/perf/util/evlist.c
b/tools/perf/util/evlist.c
index 963d63dde457bba5a32211c086064e0a045e7f8a..fa1837088ca880ca5968709326e94f22fa436db4 100644
(file)
--- a/
tools/perf/util/evlist.c
+++ b/
tools/perf/util/evlist.c
@@
-563,6
+563,8
@@
int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages,
/* 512 kiB: default amount of unprivileged mlocked memory */
if (pages == UINT_MAX)
pages = (512 * 1024) / page_size;
+ else if (!is_power_of_2(pages))
+ return -EINVAL;
mask = pages * page_size - 1;