aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-10-16 13:51:04 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-17 10:45:38 -0400
commit356712f6e296fdae1edae51b96b485ed830bdc0c (patch)
treec39d432024ac279c23ae4d9083fc103b1fcc7125 /tools/perf
parent743df75ff10630f1f2a461f0f4b51f601f53ec44 (diff)
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. 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>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/python.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 9181bf212fb9..a2657fd96837 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -1015,6 +1015,8 @@ PyMODINIT_FUNC initperf(void)
1015 pyrf_cpu_map__setup_types() < 0) 1015 pyrf_cpu_map__setup_types() < 0)
1016 return; 1016 return;
1017 1017
1018 page_size = sysconf(_SC_PAGE_SIZE);
1019
1018 Py_INCREF(&pyrf_evlist__type); 1020 Py_INCREF(&pyrf_evlist__type);
1019 PyModule_AddObject(module, "evlist", (PyObject*)&pyrf_evlist__type); 1021 PyModule_AddObject(module, "evlist", (PyObject*)&pyrf_evlist__type);
1020 1022