lkml.org 
[lkml]   [2012]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 08/11] perf python: Initialize 'page_size' variable
Date
Hi Arnaldo,

On Wed, 17 Oct 2012 14:19:44 -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> The commit 0c1fe6b:
>
> 'perf tools: Have the page size value available for all tools'

Is that commit in your perf/urgent branch? I got this:

GEN python/perf.so
util/python.c: In function ‘initperf’:
util/python.c:1018:2: error: ‘page_size’ undeclared (first use in this function)
util/python.c:1018:2: note: each undeclared identifier is reported only once for each function it appears in
error: command 'gcc' failed with exit status 1
cp: cannot stat `python_ext_build/lib/perf.so': No such file or directory
make: *** [python/perf.so] Error 1

Adding '#include "util.h"' didn't work. But manually adding 'extern
unsigned int page_size;' did.

Thanks,
Namhyung


>
> 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>
> ---
> tools/perf/util/python.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
> index 9181bf2..a2657fd 100644
> --- a/tools/perf/util/python.c
> +++ b/tools/perf/util/python.c
> @@ -1015,6 +1015,8 @@ PyMODINIT_FUNC initperf(void)
> pyrf_cpu_map__setup_types() < 0)
> return;
>
> + page_size = sysconf(_SC_PAGE_SIZE);
> +
> Py_INCREF(&pyrf_evlist__type);
> PyModule_AddObject(module, "evlist", (PyObject*)&pyrf_evlist__type);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-10-18 04:21    [W:0.075 / U:1.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site