perf probe: Make --line checks validate C-style function name
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Wed, 6 May 2015 12:46:47 +0000 (21:46 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 8 May 2015 19:05:02 +0000 (16:05 -0300)
commit573709fdfd668423ba4202c4f1016e3cd7bdd134
tree70849a27029c3cfe4aeb4eda0cc16be6ad80f2c4
parent9bc9f3b6800e8de16f40a2da1d6ded3a391ea01a
perf probe: Make --line checks validate C-style function name

Fix --line to check valid C-style function name and returns
a semantic error if it is not.

For example, previously, --line doesn't support lazy pattern
but it doesn't recognized as a semantic error.

  ----
  # perf probe -L 'func;return*:0-10'
  Specified source line is not found.
    Error: Failed to show lines.
  ----

With this patch, it is correctly handled as a semantic error.
  ----
  # perf probe -L 'func;return*:0-10'
  Semantic error :'func;return*' is not a valid function name.
  ...
  ----

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150506124647.4961.99473.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-event.c