perf test: Suppress libtraceevent warnings
authorNamhyung Kim <namhyung@kernel.org>
Mon, 19 Oct 2015 15:23:49 +0000 (00:23 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 19 Oct 2015 17:58:10 +0000 (14:58 -0300)
commit2690c730935873065175de33f59cce5bb221b9dc
tree0d731599e986a75288588307d42737957788287d
parent8719138318316656988dbd422461c1addc9a9159
perf test: Suppress libtraceevent warnings

Currently libtraceevent emits warning on unsupported event formats.
However it'd be better to see them only -v option is given.  To do that,
it needs to override the warning() function which is used in the
libtracevent.  Thus add set_warning_routine() same as set_die_routine()
and check the verbose flag in our warning routine.

Before:
  # perf test 5
   5: parse events tests                                       :
    Warning: [kvmmmu:kvm_mmu_get_page] bad op token {
    Warning: [kvmmmu:kvm_mmu_sync_page] bad op token {
    Warning: [kvmmmu:kvm_mmu_unsync_page] bad op token {
    Warning: [kvmmmu:kvm_mmu_prepare_zap_page] bad op token {
    Warning: [kvmmmu:fast_page_fault] function is_writable_pte not defined
    ...
   Ok

After:
  # perf test 5
   5: parse events tests                                       : Ok

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: David 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-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/parse-events.c
tools/perf/util/usage.c
tools/perf/util/util.h