• Namhyung Kim's avatar
    perf test: Silence tracepoint event failures · 87191383
    Namhyung Kim authored
    Currently, when 'perf test' is run by a normal user, it'll fail to
    access tracepoint events.  The output becomes somewhat messy because it
    tries to be nice with long error messages and hints.
    
    IMHO this is not needed for 'perf test' by default and AFAIK 'perf test'
    uses pr_debug() rather than pr_err() for such messages so that one can
    use -v option to see further details on failed testcases if needed.
    
    Before:
      $ perf test
       1: vmlinux symtab matches kallsyms                          : FAILED!
       2: detect openat syscall event                              :Error:
      No permissions to read
      /sys/kernel/debug/tracing/events/syscalls/sys_enter_openat
      Hint:	Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
      FAILED!
       3: detect openat syscall event on all cpus                  :Error:
      No permissions to read
      /sys/kernel/debug/tracing/events/syscalls/sys_enter_openat
      Hint:	Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
      FAILED!
       ...
    
    After:
      $ perf test
       1: vmlinux symtab matches kallsyms                          : FAILED!
       2: detect openat syscall event                              : FAILED!
       3: detect openat syscall event on all cpus                  : FAILED!
       ...
    
      $ perf test -v 2
       2: detect openat syscall event                              :
      --- start ---
      test child forked, pid 30575
      Error:	    No permissions to read
      /sys/kernel/debug/tracing/events/syscalls/sys_enter_openat
      Hint:  Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
    
      test child finished with -1
      ---- end ----
      detect openat syscall event: FAILED!
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Wang Nan <wangnan0@huawei.com>
    Link: http://lkml.kernel.org/r/1445268229-1601-1-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    87191383
openat-syscall-all-cpus.c 2.91 KB