[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1268333592-30872-1-git-send-email-acme@infradead.org>
Date: Thu, 11 Mar 2010 15:53:11 -0300
From: Arnaldo Carvalho de Melo <acme@...radead.org>
To: Ingo Molnar <mingo@...e.hu>
Cc: linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Frédéric Weisbecker <fweisbec@...il.com>,
Mike Galbraith <efault@....de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>, stable@...nel.org
Subject: [PATCH 1/2] perf record: Don't try to find buildids in a zero sized file
From: Arnaldo Carvalho de Melo <acme@...hat.com>
Fixing this symptom:
[acme@...a linux-2.6-tip]$ perf record -a -f
Fatal: Permission error - are you root?
Bus error
[acme@...a linux-2.6-tip]$
I.e. if for some reason no data is collected, in this case a non root user
trying to do systemwide profiling, no data will be collected, and then we end
up trying to mmap a zero sized file and access the file header, b00m.
Reported-by: Ingo Molnar <mingo@...e.hu>
Cc: Frédéric Weisbecker <fweisbec@...il.com>
Cc: Mike Galbraith <efault@....de>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: stable@...nel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/builtin-record.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index f573bbb..3bf1409 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -394,6 +394,9 @@ static int process_buildids(void)
{
u64 size = lseek(output, 0, SEEK_CUR);
+ if (size == 0)
+ return 0;
+
session->fd = output;
return __perf_session__process_events(session, post_processing_offset,
size - post_processing_offset,
--
1.5.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists