lkml.org 
[lkml]   [2013]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 02/11] perf evsel: Handle ENODEV on default cycles event
    Date
    From: David Ahern <dsahern@gmail.com>

    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) {
    /*
    --
    1.8.1.4


    \
     
     \ /
      Last update: 2013-07-22 22:41    [W:3.136 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site