• Masami Hiramatsu's avatar
    perf probe: Show error code and description in verbose mode · b4bf1130
    Masami Hiramatsu authored
    Show error code and description only in verbose mode if 'perf probe'
    command failed.
    
    Current 'perf probe' shows error code with final error message, and that
    is meaningless for many users.
    
    This changes error messages to show the error code and its description
    only in verbose mode (-v option).
    
    Without this patch:
      -----
      # perf probe -a do_execve@hoge
      Probe point 'do_execve@hoge' not found.
        Error: Failed to add events. (-2)
      -----
    
    With this patch, normally the message doesn't show the misterious error
    number:
      -----
      # perf probe -a do_execve@hoge
      Probe point 'do_execve@hoge' not found.
        Error: Failed to add events.
      -----
    
    And in verbose mode, it also shows additional error messages as below:
      -----
      # perf probe -va do_execve@hoge
      probe-definition(0): do_execve@hoge
      symbol:do_execve file:hoge line:0 offset:0 return:0 lazy:(null)
      0 arguments
      Looking at the vmlinux_path (6 entries long)
      Using /lib/modules/3.15.0-rc8+/build/vmlinux for symbols
      Open Debuginfo file: /lib/modules/3.15.0-rc8+/build/vmlinux
      Try to find probe point from debuginfo.
      Probe point 'do_execve@hoge' not found.
        Error: Failed to add events. Reason: No such file or directory (Code: -2)
      -----
    Reported-by: default avatarArnaldo Carvalho de Melo <acme@kernel.org>
    Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/20140606071352.6788.76943.stgit@kbuild-fedora.novalocalSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    b4bf1130
builtin-probe.c 13.7 KB