diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-09-07 04:38:06 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-09-15 08:48:33 -0400 |
commit | 8dd2a1317eba2c207632dcb19adb7cb746861652 (patch) | |
tree | 15d062f65152a883e2dd459f397bbcf5b1cffe68 /tools/perf/util/parse-events.c | |
parent | e2f9f8ea6a54e252e3a94a5c2321f673b5b97360 (diff) |
perf evsel: Propagate error info from tp_format
Propagate error info from tp_format via ERR_PTR to get it all the way
down to the parse-event.c tracepoint adding routines. Following
functions now return pointer with encoded error:
- tp_format
- trace_event__tp_format
- perf_evsel__newtp_idx
- perf_evsel__newtp
This affects several other places in perf, that cannot use pointer check
anymore, but must utilize the err.h interface, when getting error
information from above functions list.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Raphael Beamonte <raphael.beamonte@gmail.com>
Link: http://lkml.kernel.org/r/1441615087-13886-5-git-send-email-jolsa@kernel.org
[ Add two missing ERR_PTR() and one IS_ERR() ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 1b284b8ad243..c47831c47220 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <linux/hw_breakpoint.h> | 1 | #include <linux/hw_breakpoint.h> |
2 | #include <linux/err.h> | ||
2 | #include "util.h" | 3 | #include "util.h" |
3 | #include "../perf.h" | 4 | #include "../perf.h" |
4 | #include "evlist.h" | 5 | #include "evlist.h" |
@@ -393,11 +394,10 @@ static int add_tracepoint(struct list_head *list, int *idx, | |||
393 | struct perf_evsel *evsel; | 394 | struct perf_evsel *evsel; |
394 | 395 | ||
395 | evsel = perf_evsel__newtp_idx(sys_name, evt_name, (*idx)++); | 396 | evsel = perf_evsel__newtp_idx(sys_name, evt_name, (*idx)++); |
396 | if (!evsel) | 397 | if (IS_ERR(evsel)) |
397 | return -ENOMEM; | 398 | return PTR_ERR(evsel); |
398 | 399 | ||
399 | list_add_tail(&evsel->node, list); | 400 | list_add_tail(&evsel->node, list); |
400 | |||
401 | return 0; | 401 | return 0; |
402 | } | 402 | } |
403 | 403 | ||