linux/tools/perf
Adrian Hunter 1dbfa9387b perf evlist: Fix mmap pages rounding to power of 2
'next_pow2()' only works for 'unsigned int' but the argument is
'unsigned long'.  Checking for values less than (1 << 31) ensures that
'next_pow2()' is not passed a value out of range but lets anything else
go through unvalidated.

As a result mmap_pages of zero is used e.g.

  perf record -v -m2147483649 uname
  mmap size 0B
  failed to mmap with 22 (Invalid argument)

Fixed:

  perf record -m2147483649 uname
  rounding mmap pages size to 17592186044416 bytes (4294967296 pages)
  Invalid argument for --mmap_pages/-m

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1386595120-22978-4-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-12-09 15:18:05 -03:00
..
Documentation perf script: Add an option to print the source line number 2013-12-09 14:47:15 -03:00
arch Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
bench perf bench: Fix two warnings 2013-11-01 10:41:54 -03:00
config perf tools: Add build and install plugins targets 2013-12-04 15:19:35 -03:00
python perf python: Remove duplicate TID bit from mask 2013-08-07 17:35:25 -03:00
scripts perf tools: Finish the removal of 'self' arguments 2013-11-05 15:32:36 -03:00
tests perf record: Make per-cpu mmaps the default. 2013-11-27 14:58:36 -03:00
ui perf ui browser: Fix segfault caused by off by one handling END key 2013-11-14 16:00:31 -03:00
util perf evlist: Fix mmap pages rounding to power of 2 2013-12-09 15:18:05 -03:00
.gitignore perf tools: Ignore 'perf timechart' output file 2013-10-11 12:17:37 -03:00
CREDITS
MANIFEST
Makefile perf tools: Fix tags/TAGS targets rebuilding 2013-11-27 16:47:14 -03:00
Makefile.perf perf tools: Add trace-event object 2013-12-04 15:20:52 -03:00
builtin-annotate.c perf hists: Consolidate __hists__add_*entry() 2013-11-04 20:59:09 -03:00
builtin-bench.c perf bench: Change the procps visible command-name of invididual benchmark tests plus cleanups 2013-10-23 09:57:34 -03:00
builtin-buildid-cache.c perf tools: Add data object to handle perf data file 2013-10-21 17:33:24 -03:00
builtin-buildid-list.c perf session: Separating data file properties from session 2013-10-21 17:33:25 -03:00
builtin-diff.c perf hists: Consolidate __hists__add_*entry() 2013-11-04 20:59:09 -03:00
builtin-evlist.c perf tools: Add data object to handle perf data file 2013-10-21 17:33:24 -03:00
builtin-help.c
builtin-inject.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-kmem.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-kvm.c perf target: Shorten perf_target__ to target__ 2013-11-12 16:51:03 -03:00
builtin-list.c perf list: Add usage 2013-11-05 14:26:41 -03:00
builtin-lock.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-mem.c perf tools: Add data object to handle perf data file 2013-10-21 17:33:24 -03:00
builtin-probe.c perf probe: Add '--demangle'/'--no-demangle' 2013-11-14 16:06:28 -03:00
builtin-record.c perf record: Fix display of incorrect mmap pages 2013-12-09 15:17:23 -03:00
builtin-report.c perf hists: Consolidate __hists__add_*entry() 2013-11-04 20:59:09 -03:00
builtin-sched.c perf evsel: Ditch evsel->handler.data field 2013-11-07 10:40:47 -03:00
builtin-script.c perf script: Add an option to print the source line number 2013-12-09 14:47:15 -03:00
builtin-stat.c tools/perf/stat: Add event unit and scale support 2013-11-27 11:16:39 +01:00
builtin-timechart.c perf timechart: Move wake_events list to 'struct timechart' 2013-12-02 09:22:47 -03:00
builtin-top.c perf symbols: Move idle syms check from top to generic function 2013-11-27 14:58:37 -03:00
builtin-trace.c perf trace: Fix summary percentage when processing files 2013-12-05 10:09:58 -03:00
builtin.h
command-list.txt
design.txt
perf-archive.sh
perf-completion.sh perf completion: Rename file to reflect zsh support 2013-11-27 14:58:35 -03:00
perf.c perf trace: Add 'trace' alias to 'perf trace' 2013-10-11 12:17:10 -03:00
perf.h perf record: Default -t option to no inheritance 2013-11-27 14:58:36 -03:00