aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2010-05-17 12:20:43 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-17 12:23:18 -0300
commit3de29cab1f8d62db557a4afed0fb17eebfe64438 (patch)
tree6e1688a1bf0bff8a85cebc6e9c7edb1300e2cd20 /tools/perf/util
parentperf options: Introduce OPT_U64 (diff)
downloadlinux-dev-3de29cab1f8d62db557a4afed0fb17eebfe64438.tar.xz
linux-dev-3de29cab1f8d62db557a4afed0fb17eebfe64438.zip
perf record: Fix bug mismatch with -c option definition
The -c option defines the user requested sampling period. It was implemented using an unsigned int variable but the type of the option was OPT_LONG. Thus, the option parser was overwriting memory belonging to other variables, namely the mmap_pages leading to a zero page sampling buffer. The bug was exposed only when compiling at -O0, probably because the compiler was padding variables at higher optimization levels. This patch fixes this problem by declaring user_interval as u64. This also avoids wrap-around issues for large period on 32-bit systems. Commiter note: Made it use OPT_U64(user_interval) after implementing OPT_U64 in the previous patch. Cc: David S. Miller <davem@davemloft.net> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <4bf11ae9.e88cd80a.06b0.ffffa8e3@mx.google.com> Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
0 files changed, 0 insertions, 0 deletions