linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf: Fix python argument name list of read_on_cpu()
@ 2011-03-31 16:27 Frederic Weisbecker
  2011-03-31 16:27 ` [PATCH 2/2] perf: Cleanup useless double NULL termination in python method arg names Frederic Weisbecker
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2011-03-31 16:27 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: LKML, Frederic Weisbecker, Ingo Molnar, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Paul Mackerras, Stephane Eranian,
	David Ahern, Tom Zanussi

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@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: David Ahern <daahern@cisco.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-04 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-31 16:27 [PATCH 1/2] perf: Fix python argument name list of read_on_cpu() Frederic Weisbecker
2011-03-31 16:27 ` [PATCH 2/2] perf: Cleanup useless double NULL termination in python method arg names Frederic Weisbecker
2011-06-03 13:37   ` [tip:perf/core] perf python: Cleanup useless double NULL termination in " tip-bot for Frederic Weisbecker
2011-06-03 13:37 ` [tip:perf/core] perf python: Fix argument name list of read_on_cpu() tip-bot for Frederic Weisbecker
2011-06-04 11:05 ` tip-bot for Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).