diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 42e24149c79198554f718b3570c78051d8f9238c..1a9098c697b44a0d181aa28fd2192578f27150af 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -242,9 +242,13 @@ static void perf_record__open(struct perf_record *rec) /* * If it's cycles then fall back to hrtimer * based cpu-clock-tick sw counter, which - * is always available even if no PMU support: + * is always available even if no PMU support. + * + * PPC returns ENXIO until 2.6.37 (behavior changed + * with commit b0a873e). */ - if (err == ENOENT && attr->type == PERF_TYPE_HARDWARE + if ((err == ENOENT || err == ENXIO) + && attr->type == PERF_TYPE_HARDWARE && attr->config == PERF_COUNT_HW_CPU_CYCLES) { if (verbose)