[PATCH 1/2] perf: Fix python argument name list of read_on_cpu()
From: Frederic Weisbecker
Date: Thu Mar 31 2011 - 12:27:55 EST
Mandatory arguments need to be present in the argument name
list, as well as optional arguments, otherwise python barfs:
# ./python/twatch.py
Traceback (most recent call last):
File "./python/twatch.py", line 41, in <module>
main()
File "./python/twatch.py", line 32, in main
event = evlist.read_on_cpu(cpu)
RuntimeError: more argument specifiers than keyword list entries
Hence, add cpu to the name list.
Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Cc: David Ahern <daahern@xxxxxxxxx>
Cc: Tom Zanussi <tzanussi@xxxxxxxxx>
---
tools/perf/util/python.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index a9f2d7e..2914221 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -673,7 +673,7 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist,
struct perf_evlist *evlist = &pevlist->evlist;
union perf_event *event;
int sample_id_all = 1, cpu;
- static char *kwlist[] = {"sample_id_all", NULL, NULL};
+ static char *kwlist[] = {"cpu", "sample_id_all", NULL, NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|i", kwlist,
&cpu, &sample_id_all))
--
1.7.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/