* [tip:perf/core] perf scripting python: Use Py_FatalError instead of die()
@ 2016-05-12 10:21 tip-bot for Arnaldo Carvalho de Melo
0 siblings, 0 replies; only message in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2016-05-12 10:21 UTC (permalink / raw)
To: linux-tip-commits
Cc: wangnan0, adrian.hunter, jolsa, linux-kernel, mingo, dsahern,
acme, tglx, cphlipot0, hpa, namhyung
Commit-ID: 62665dff754a80e2fdd214ef2ed21abb2a7d03a2
Gitweb: http://git.kernel.org/tip/62665dff754a80e2fdd214ef2ed21abb2a7d03a2
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 10 May 2016 12:33:52 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 11 May 2016 12:24:57 -0300
perf scripting python: Use Py_FatalError instead of die()
It probably is equivalent, but that seems to be the "pythonic" way of
dieing? Anyway, one less die() in the tools/perf codebase.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Chris Phlipot <cphlipot0@gmail.com>
Link: http://lkml.kernel.org/n/tip-nlzgepdv2818zs4e7faif9tu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/scripting-engines/trace-event-python.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 1546b74..73ee12d 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -408,8 +408,11 @@ static void python_process_tracepoint(struct perf_sample *sample,
if (!t)
Py_FatalError("couldn't create Python tuple");
- if (!event)
- die("ug! no event found for type %d", (int)evsel->attr.config);
+ if (!event) {
+ snprintf(handler_name, sizeof(handler_name),
+ "ug! no event found for type %" PRIu64, (u64)evsel->attr.config);
+ Py_FatalError(handler_name);
+ }
pid = raw_field_value(event, "common_pid", data);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-12 10:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12 10:21 [tip:perf/core] perf scripting python: Use Py_FatalError instead of die() tip-bot for Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox