perf python: Fix argument name list of read_on_cpu()
authorFrederic Weisbecker <[email protected]>
Thu, 31 Mar 2011 16:27:42 +0000 (18:27 +0200)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 3 Jun 2011 13:09:22 +0000 (10:09 -0300)
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.

Cc: David Ahern <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Tom Zanussi <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Frederic Weisbecker <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/python.c

index 24063b4d41e0c96a460de0167731c58e0dd6e43f..a9ac0504aabd25f3dc4a528f5e86d291eed4da05 100644 (file)
@@ -674,7 +674,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};
        int err;
 
        if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|i", kwlist,