perf evlist: Add a debug print if event buffer mmap fails
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 1 Nov 2013 13:51:33 +0000 (15:51 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 4 Nov 2013 15:21:41 +0000 (12:21 -0300)
Add a debug print if mmap of the perf event ring buffer fails.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1383313899-15987-6-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evlist.c

index 0582f67fbefc42bf88c0b7861aa21afbf6333011..1c173ccb0ef2849233ea2d3a5e8b089267fbebcc 100644 (file)
@@ -607,6 +607,8 @@ static int __perf_evlist__mmap(struct perf_evlist *evlist,
        evlist->mmap[idx].base = mmap(NULL, evlist->mmap_len, prot,
                                      MAP_SHARED, fd, 0);
        if (evlist->mmap[idx].base == MAP_FAILED) {
+               pr_debug2("failed to mmap perf event ring buffer, error %d\n",
+                         errno);
                evlist->mmap[idx].base = NULL;
                return -1;
        }