perf record/top: handle ENODEV on default cycles event
PATCH 1/1 perf record/top: handle ENODEV on default cycles event
Some systems (e.g., VMs on qemu-0.13 with the default vcpu model) report an unsupported CPU model:
Performance Events: unsupported p6 CPU model 2 no PMU driver, software events only.
Subsequent invocations of perf fail with:
The sys_perf_event_open() syscall returned with 19 (No such device) for event (cycles). /bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?
Add ENODEV to the list of errno's to fallback to cpu-clock.
--- tools/perf/util/evsel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/evsel.c +1 -1
@@ -1482,7 +1482,7 @@ out:bool perf_evsel__fallback (struct perf_evsel *evsel,int err,char *msg,size_t msgsize) { -if ((err ==ENOENT || err ==ENXIO ) && +if ((err ==ENOENT || err ==ENXIO || err ==ENODEV ) && evsel->attr.type ==PERF_TYPE_HARDWARE && evsel->attr.config ==PERF_COUNT_HW_CPU_CYCLES ) {/*
Signature · 1 line
1.7.10.1
Arnaldo Carvalho de Melo
AppliedEm Thu, Jul 18, 2013 at 05:27:59PM -0600, David Ahern escreveu:
Quoted 5 lines
Some systems (e.g., VMs on qemu-0.13 with the default vcpu model) report an unsupported CPU model:
Performance Events: unsupported p6 CPU model 2 no PMU driver, software events only.
Quoted 7 lines
Subsequent invocations of perf fail with:
The
sys_perf_event_open()syscall returned with 19 (No such device) for event (cycles)./bin/dmesgmay provide additional information.
NoCONFIG_PERF_EVENTS=ykernel support configured?Add ENODEV to the list of errno's to fallback to cpu-clock.
Thanks, applied.
- Arnaldo
tip-bot for David Ahern
merge bot[tip:perf/core] perf evsel: Handle ENODEV on default cycles event
In reply to David Ahernperf evsel: Handle ENODEV on default cycles event
Commit-ID: 2b821cce1c950cead081d779db0dda680192c4bd Gitweb: http://git.kernel.org/tip/2b821cce1c950cead081d779db0dda680192c4bd Author: David Ahern <[email protected]> AuthorDate: Thu, 18 Jul 2013 17:27:59 -0600 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 22 Jul 2013 12:03:57 -0300
perf evsel: Handle ENODEV on default cycles event
Some systems (e.g., VMs on qemu-0.13 with the default vcpu model) report an unsupported CPU model:
Performance Events: unsupported p6 CPU model 2 no PMU driver, software events only.
Subsequent invocations of perf fail with:
The sys_perf_event_open() syscall returned with 19 (No such device) for event (cycles). /bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?
Add ENODEV to the list of errno's to fallback to cpu-clock.
--- tools/perf/util/evsel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/evsel.c +1 -1
@@ -1482,7 +1482,7 @@ out:bool perf_evsel__fallback (struct perf_evsel *evsel,int err,char *msg,size_t msgsize) { -if ((err ==ENOENT || err ==ENXIO ) && +if ((err ==ENOENT || err ==ENXIO || err ==ENODEV ) && evsel->attr.type ==PERF_TYPE_HARDWARE && evsel->attr.config ==PERF_COUNT_HW_CPU_CYCLES ) {/*