summaryrefslogtreecommitdiff
path: root/tools/perf/util/parse-events.y
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-04-22 21:10:17 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-04-29 10:37:59 -0300
commit6297d42372b6ff02135ce170b0d90ccf0b1531e4 (patch)
tree9cd8049cffd0dd8731f8774a214ecd1b637cd2b4 /tools/perf/util/parse-events.y
parentb39b839309ce8c5dd15cd95d26af153fa392c3e6 (diff)
perf tools: Add flex support for parse_events_error
Allowing flex parser to report back event parsing error, like: $ perf record -e cycles,cache-mises ls event syntax error: '..es,cache-mises' \___ parser error ... Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> 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/1429729824-13932-3-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.y')
-rw-r--r--tools/perf/util/parse-events.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 72def077dbbf..14521ce534d9 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -2,6 +2,7 @@
%parse-param {void *_data}
%parse-param {void *scanner}
%lex-param {void* scanner}
+%locations
%{
@@ -14,8 +15,6 @@
#include "parse-events.h"
#include "parse-events-bison.h"
-extern int parse_events_lex (YYSTYPE* lvalp, void* scanner);
-
#define ABORT_ON(val) \
do { \
if (val) \
@@ -520,7 +519,9 @@ sep_slash_dc: '/' | ':' |
%%
-void parse_events_error(void *data __maybe_unused, void *scanner __maybe_unused,
+void parse_events_error(YYLTYPE *loc, void *data,
+ void *scanner __maybe_unused,
char const *msg __maybe_unused)
{
+ parse_events_evlist_error(data, loc->last_column, "parser error");
}