All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf record/top: handle ENODEV on default cycles event
@ 2013-07-18 23:27 David Ahern
  2013-07-22 15:05 ` Arnaldo Carvalho de Melo
  2013-07-23  7:46 ` [tip:perf/core] perf evsel: Handle " tip-bot for David Ahern
  0 siblings, 2 replies; 3+ messages in thread
From: David Ahern @ 2013-07-18 23:27 UTC (permalink / raw)
  To: acme, linux-kernel
  Cc: David Ahern, Ingo Molnar, Frederic Weisbecker, Peter Zijlstra,
	Jiri Olsa

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.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Jiri Olsa <jolsa@redhat.com>
---
 tools/perf/util/evsel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index a635461..8bed0c1 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -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) {
 		/*
-- 
1.7.10.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf record/top: handle ENODEV on default cycles event
  2013-07-18 23:27 [PATCH] perf record/top: handle ENODEV on default cycles event David Ahern
@ 2013-07-22 15:05 ` Arnaldo Carvalho de Melo
  2013-07-23  7:46 ` [tip:perf/core] perf evsel: Handle " tip-bot for David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-07-22 15:05 UTC (permalink / raw)
  To: David Ahern
  Cc: linux-kernel, Ingo Molnar, Frederic Weisbecker, Peter Zijlstra,
	Jiri Olsa

Em Thu, Jul 18, 2013 at 05:27:59PM -0600, David Ahern escreveu:
> 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.

Thanks, applied.

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf evsel: Handle ENODEV on default cycles event
  2013-07-18 23:27 [PATCH] perf record/top: handle ENODEV on default cycles event David Ahern
  2013-07-22 15:05 ` Arnaldo Carvalho de Melo
@ 2013-07-23  7:46 ` tip-bot for David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for David Ahern @ 2013-07-23  7:46 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, hpa, mingo, peterz, jolsa, fweisbec, dsahern,
	tglx

Commit-ID:  2b821cce1c950cead081d779db0dda680192c4bd
Gitweb:     http://git.kernel.org/tip/2b821cce1c950cead081d779db0dda680192c4bd
Author:     David Ahern <dsahern@gmail.com>
AuthorDate: Thu, 18 Jul 2013 17:27:59 -0600
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1374190079-28507-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/evsel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index a635461..8bed0c1 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -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) {
 		/*

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-23  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-18 23:27 [PATCH] perf record/top: handle ENODEV on default cycles event David Ahern
2013-07-22 15:05 ` Arnaldo Carvalho de Melo
2013-07-23  7:46 ` [tip:perf/core] perf evsel: Handle " tip-bot for David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.