diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-11-16 22:18:09 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-17 01:19:54 -0500 |
commit | 11deb1f9f6ca6318fa9470e024b9f0634df48b4c (patch) | |
tree | 3f1e18ccaffa47e1a139c1f2f12f94510c3a4751 /tools/perf/builtin-record.c | |
parent | 1124ba73be6a758965340bd997593b2996649d60 (diff) |
perf tools: Don't die() in perf_header__add_attr()
Propagate the errors instead, the users are the ones to decide
what to do if a library call fails.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1258427892-16312-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 4c03bb7a4eba..5411be4cfd77 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -221,7 +221,10 @@ static struct perf_header_attr *get_header_attr(struct perf_event_attr *a, int n | |||
221 | } else { | 221 | } else { |
222 | h_attr = perf_header_attr__new(a); | 222 | h_attr = perf_header_attr__new(a); |
223 | if (h_attr != NULL) | 223 | if (h_attr != NULL) |
224 | perf_header__add_attr(header, h_attr); | 224 | if (perf_header__add_attr(header, h_attr) < 0) { |
225 | perf_header_attr__delete(h_attr); | ||
226 | h_attr = NULL; | ||
227 | } | ||
225 | } | 228 | } |
226 | 229 | ||
227 | return h_attr; | 230 | return h_attr; |