From: Arnaldo Carvalho de Melo Date: Tue, 10 May 2016 15:33:52 +0000 (-0300) Subject: perf scripting python: Use Py_FatalError instead of die() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=62665dff754a80e2fdd214ef2ed21abb2a7d03a2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Cc: Chris Phlipot Link: http://lkml.kernel.org/n/tip-nlzgepdv2818zs4e7faif9tu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 1546b749a3a3..73ee12d96c33 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);