perf python: Initialize 'page_size' variable
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 16 Oct 2012 17:51:04 +0000 (14:51 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 29 Oct 2012 14:36:46 +0000 (12:36 -0200)
commit0da2e9c24804d787cbc919b3e0d28ee7c00240ff
treed480571278f5952b3f22e43ebb6c75cd0416db5a
parent0089fa9831f3752869143c7928adb94ac6353085
perf python: Initialize 'page_size' variable

The commit 0c1fe6b:

 'perf tools: Have the page size value available for all tools'

Broke the python binding because the global variable 'page_size' is
initialized on the main() routine, that is not called when using
just the python binding, causing evlist.mmap() to fail because it
expects that variable to be initialized to the system's page size.

Fix it by initializing it on the binding init routine.

Reported-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.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 <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-vrvp3azmbfzexnpmkhmvtzzc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/python.c