diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-10-25 16:30:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-10-28 09:29:44 -0400 |
commit | 9a8860bbaa936407aa95d7d3ef836036a117b207 (patch) | |
tree | ed9e8372df152aa582effafaede80e0e1dfddb30 /tools/perf/util/trace-event-scripting.c | |
parent | cf346d5bd4b9d61656df2f72565c9b354ef3ca0d (diff) |
perf scripting: Don't die if scripting can't be setup, disable it
Removing one more set of die() calls.
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>
Link: http://lkml.kernel.org/n/tip-6pyil685m5i2tugg56gcy0tg@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
-rw-r--r-- | tools/perf/util/trace-event-scripting.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c index a2fd6e79d5a5..0ac9077f62a2 100644 --- a/tools/perf/util/trace-event-scripting.c +++ b/tools/perf/util/trace-event-scripting.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <errno.h> | 25 | #include <errno.h> |
26 | 26 | ||
27 | #include "../perf.h" | 27 | #include "../perf.h" |
28 | #include "debug.h" | ||
28 | #include "util.h" | 29 | #include "util.h" |
29 | #include "trace-event.h" | 30 | #include "trace-event.h" |
30 | 31 | ||
@@ -86,17 +87,15 @@ struct scripting_ops python_scripting_unsupported_ops = { | |||
86 | 87 | ||
87 | static void register_python_scripting(struct scripting_ops *scripting_ops) | 88 | static void register_python_scripting(struct scripting_ops *scripting_ops) |
88 | { | 89 | { |
89 | int err; | ||
90 | err = script_spec_register("Python", scripting_ops); | ||
91 | if (err) | ||
92 | die("error registering Python script extension"); | ||
93 | |||
94 | err = script_spec_register("py", scripting_ops); | ||
95 | if (err) | ||
96 | die("error registering py script extension"); | ||
97 | |||
98 | if (scripting_context == NULL) | 90 | if (scripting_context == NULL) |
99 | scripting_context = malloc(sizeof(*scripting_context)); | 91 | scripting_context = malloc(sizeof(*scripting_context)); |
92 | |||
93 | if (scripting_context == NULL || | ||
94 | script_spec_register("Python", scripting_ops) || | ||
95 | script_spec_register("py", scripting_ops)) { | ||
96 | pr_err("Error registering Python script extension: disabling it\n"); | ||
97 | zfree(&scripting_context); | ||
98 | } | ||
100 | } | 99 | } |
101 | 100 | ||
102 | #ifdef NO_LIBPYTHON | 101 | #ifdef NO_LIBPYTHON |
@@ -151,17 +150,15 @@ struct scripting_ops perl_scripting_unsupported_ops = { | |||
151 | 150 | ||
152 | static void register_perl_scripting(struct scripting_ops *scripting_ops) | 151 | static void register_perl_scripting(struct scripting_ops *scripting_ops) |
153 | { | 152 | { |
154 | int err; | ||
155 | err = script_spec_register("Perl", scripting_ops); | ||
156 | if (err) | ||
157 | die("error registering Perl script extension"); | ||
158 | |||
159 | err = script_spec_register("pl", scripting_ops); | ||
160 | if (err) | ||
161 | die("error registering pl script extension"); | ||
162 | |||
163 | if (scripting_context == NULL) | 153 | if (scripting_context == NULL) |
164 | scripting_context = malloc(sizeof(*scripting_context)); | 154 | scripting_context = malloc(sizeof(*scripting_context)); |
155 | |||
156 | if (scripting_context == NULL || | ||
157 | script_spec_register("Perl", scripting_ops) || | ||
158 | script_spec_register("pl", scripting_ops)) { | ||
159 | pr_err("Error registering Perl script extension: disabling it\n"); | ||
160 | zfree(&scripting_context); | ||
161 | } | ||
165 | } | 162 | } |
166 | 163 | ||
167 | #ifdef NO_LIBPERL | 164 | #ifdef NO_LIBPERL |