Skip to content

RFC perf tools: Add perf_evlist errno

Jiri Olsa lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6perf tools: Add perf_evlist error string interfacetools/perf/util/evlist.c tools/perf/util/evlist.h+47 -00 replies
2/6perf tools: Add PERF_EVLIST__ERRNO_MMAP internal errortools/perf/util/evlist.c tools/perf/util/evlist.h+29 -00 replies
3/6perf tools: Add PERF_EVLIST__ERRNO_OPEN internal errortools/perf/builtin-trace.c tools/perf/util/evlist.c tools/perf/util/evlist.h+45 -430 replies
4/6perf tools: Add PERF_EVLIST__ERRNO_IOCTL_ID_GROUP internal errortools/perf/util/evlist.c tools/perf/util/evlist.h+9 -10 replies
5/6perf tools: Add PERF_EVLIST__ERRNO_NEWTP internal errortools/perf/builtin-trace.c tools/perf/util/evlist.c tools/perf/util/evlist.h+55 -490 replies
6/6perf tools: Use perf_evlist__strerror in kvm/record/top/trace commandstools/perf/builtin-kvm.c tools/perf/builtin-record.c tools/perf/builtin-top.c +1 more+5 -150 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/6] perf tools: Add perf_evlist errno

hi,
Andi reported wrong error message for :S modifier on kernel without event ID ioctl support.

The reason was that the ioctl failed, but the error was printed like the mmap would:

    $ perf.old record -e '{cycles,cache-misses}:S' ls
    failed to mmap with 25 (Inappropriate ioctl for device)
    ls: Terminated

I experimentally added sort of 'libc errno' interface for perf_evlist to be able to get proper error message, like:

    $ perf record -e '{cycles,cache-misses}:S' ls
    Cannot read event group on this kernel.
    Please consider kernel update (v3.12+).
    ls: Terminated

I'm not sure about this approach. Maybe it'd be better be more global..? So before throwing this out, sending it as RFC ;-)

thanks for ideas,
jirka

Cc Corey Ashford <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc David Ahern <[email protected]>
Cc Andi Kleen <[email protected]>

---
Jiri Olsa (6):
perf tools: Add perf_evlist error string interface
perf tools: Add PERF_EVLIST__ERRNO_MMAP internal error perf tools: Add PERF_EVLIST__ERRNO_OPEN internal error perf tools: Add PERF_EVLIST__ERRNO_IOCTL_ID_GROUP internal error perf tools: Add PERF_EVLIST__ERRNO_NEWTP internal error perf tools: Use perf_evlist__strerror in kvm/record/top/trace commands

 tools/perf/builtin-kvm.c    |   2 +-
 tools/perf/builtin-record.c |  13 +------
 tools/perf/builtin-top.c    |   3 +-
 tools/perf/builtin-trace.c  |  34 ++++++++---------
 tools/perf/util/evlist.c    | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
 tools/perf/util/evlist.h    |  23 +++++++++++-
 6 files changed, 181 insertions(+), 99 deletions(-)