perf tools: Fail properly in case pattern matching fails to find tracepoint
authorJiri Olsa <jolsa@kernel.org>
Mon, 5 Oct 2015 19:31:17 +0000 (21:31 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 5 Oct 2015 20:59:50 +0000 (17:59 -0300)
commit27bf90bf0690f55c3679bcc4c325823cf1cfd19d
treedf5ec1da23e37e944805a4ca37021fdc2a9ac4aa
parentc6c3c02dea4034431110923ffd8e296ebfbdbe1b
perf tools: Fail properly in case pattern matching fails to find tracepoint

Currently we dont fail properly when pattern matching fails to find any
tracepoint.

Current behaviour:

  $ perf record -e 'sched:krava*' sleep 1
  WARNING: event parser found nothinginvalid or unsupported event: 'sched:krava*'
  Run 'perf list' for a list of valid events

  usage: perf record [<options>] [<command>]
     or: perf record [<options>] -- <command> [<options>]

This patch change:

  $ perf record -e 'sched:krava*' sleep 1
  event syntax error: 'sched:krava*'
                       \___ unknown tracepoint

  Error:  File /sys/kernel/debug/tracing/events/sched/krava* not found.
  Hint:   Perhaps this kernel misses some CONFIG_ setting to enable this feature?.

  Run 'perf list' for a list of valid events

   usage: perf record [<options>] [<command>]
      or: perf record [<options>] -- <command> [<options>]

Reported-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1444073477-3181-1-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/parse-events.c