Re: [PATCH] perf record: fix fallback to cpu-clock on ppc

From: David Ahern
Date: Wed May 09 2012 - 12:22:46 EST

On 5/9/12 8:56 AM, Arnaldo Carvalho de Melo wrote:
Em Mon, May 07, 2012 at 10:40:04PM -0600, David Ahern escreveu:
perf-record on PPC is not falling back to cpu-clock:

Old kernel, cannot exclude guest or host samples.

Error: sys_perf_event_open() syscall returned with 6 (No such device or address). /bin/dmesg may provide additional information.

Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?

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

Old kernel, cannot exclude guest or host samples.
The cycles event is not supported, trying to fall back to cpu-clock-ticks
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.150 MB /tmp/ (~6569 samples) ]

Thanks, applied to my perf/core branch.

Can you please provide one for perf/urgent?

Not needed. Problem on perf/core was introduced by 5a7ed29c7572d00a75e8c4529e30c5ac2ef82271

The perf-stat version is needed and applies cleanly (though with an offset) to perf/urgent.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at