summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-11-16 19:30:26 -0200
committerIngo Molnar <mingo@elte.hu>2009-11-17 07:19:52 +0100
commitdc79c0fc08a94b857aed446bfb47cdfde529400c (patch)
treea68f563cf3e4a047e1948d0735de9b5991166e4d /tools/perf/builtin-record.c
parentc34984b2bbc77596c97c333539bffc90d2033178 (diff)
downloadop-kernel-dev-dc79c0fc08a94b857aed446bfb47cdfde529400c.zip
op-kernel-dev-dc79c0fc08a94b857aed446bfb47cdfde529400c.tar.gz
perf tools: Don't die in perf_header_attr__new()
We really should propagate such kinds of errors so that users of these library functions decide what to do in such cases instead of exiting in random places like now. 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: <1258407027-384-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 04f335e..4c03bb7 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -220,7 +220,8 @@ static struct perf_header_attr *get_header_attr(struct perf_event_attr *a, int n
h_attr = header->attr[nr];
} else {
h_attr = perf_header_attr__new(a);
- perf_header__add_attr(header, h_attr);
+ if (h_attr != NULL)
+ perf_header__add_attr(header, h_attr);
}
return h_attr;
@@ -308,6 +309,8 @@ try_again:
}
h_attr = get_header_attr(attr, counter);
+ if (h_attr == NULL)
+ die("nomem\n");
if (!file_new) {
if (memcmp(&h_attr->attr, attr, sizeof(*attr))) {
OpenPOWER on IntegriCloud