lkml.org 
[lkml]   [2012]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 09/11] perf top: error handling for counter creation should parallel perf-record
    Date
    5a7ed29 fixed up perf-record but not perf-top. Similar argument
    holds for it -- fallback to PMU only if it does not exist and handle
    invalid attributes separately.

    Signed-off-by: David Ahern <dsahern@gmail.com>
    Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Robert Richter <robert.richter@amd.com>
    ---
    tools/perf/builtin-top.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
    index e3cab5f..0ce665c 100644
    --- a/tools/perf/builtin-top.c
    +++ b/tools/perf/builtin-top.c
    @@ -943,8 +943,10 @@ try_again:
    * based cpu-clock-tick sw counter, which
    * is always available even if no PMU support:
    */
    - if (attr->type == PERF_TYPE_HARDWARE &&
    - attr->config == PERF_COUNT_HW_CPU_CYCLES) {
    + if ((err == ENOENT || err == ENXIO)
    + && attr->type == PERF_TYPE_HARDWARE
    + && attr->config == PERF_COUNT_HW_CPU_CYCLES) {
    +
    if (verbose)
    ui__warning("Cycles event not supported,\n"
    "trying to fall back to cpu-clock-ticks\n");
    --
    1.7.10.1


    \
     
     \ /
      Last update: 2012-07-21 02:01    [W:0.022 / U:4.720 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site