]> git.baikalelectronics.ru Git - kernel.git/commit
perf stat: handle ENXIO error for perf_event_open
authorDavid Ahern <dsahern@gmail.com>
Tue, 8 May 2012 15:29:16 +0000 (09:29 -0600)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 9 May 2012 17:14:41 +0000 (14:14 -0300)
commit115fd6c7a1ad9f03738b3e1443b009ff42aea3e1
treee7d5a8be4425eb97ac1a396c7b0f08079259d861
parente8a07f3221d15d7f876bc663be7e681df179434f
perf stat: handle ENXIO error for perf_event_open

perf stat on PPC currently fails to run:

$ perf stat -- sleep 1
  Error: open_counter returned with 6 (No such device or address). /bin/dmesg may provide additional information.

  Fatal: Not all events could be opened.

The problem is that until 2.6.37 (behavior changed with commit 0ccf41f)
perf on PPC returns ENXIO when hw_perf_event_init() fails. With this
patch we get the expected behavior:

$ perf stat -v -- sleep 1
cycles event is not supported by the kernel.
stalled-cycles-frontend event is not supported by the kernel.
stalled-cycles-backend event is not supported by the kernel.
instructions event is not supported by the kernel.
branches event is not supported by the kernel.
branch-misses event is not supported by the kernel.

...

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1336490956-57145-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c