diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-11-17 01:18:10 -0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-17 07:19:55 +0100 |
commit | 5875412152ce67fb5087157b86ab6597f91d23e8 (patch) | |
tree | 5a148dcc777433f0d097ffa072b8b1a5b0a5c346 /tools/perf/builtin-record.c | |
parent | 11deb1f9f6ca6318fa9470e024b9f0634df48b4c (diff) |
perf tools: Don't die() in perf_header_attr__add_id()
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-2-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 5411be4cfd7..2a85205ba01 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -327,7 +327,10 @@ try_again: exit(-1); } - perf_header_attr__add_id(h_attr, read_data.id); + if (perf_header_attr__add_id(h_attr, read_data.id) < 0) { + pr_warning("Not enough memory to add id\n"); + exit(-1); + } assert(fd[nr_cpu][counter] >= 0); fcntl(fd[nr_cpu][counter], F_SETFL, O_NONBLOCK); |