summaryrefslogtreecommitdiff
path: root/tools/perf/util/parse-events.y
diff options
context:
space:
mode:
authorZheng Yan <zheng.z.yan@intel.com>2012-06-15 10:31:39 +0400
committerIngo Molnar <mingo@kernel.org>2012-06-18 14:13:24 +0400
commitac20de6fff445d6deb0c44c25946d198f79f2f00 (patch)
tree8d0ec729ea5b5aa8965e46370df50167506b1e61 /tools/perf/util/parse-events.y
parent46010ab2607aed9484816a8f1679c2ec3c8e7dcf (diff)
downloadlinux-ac20de6fff445d6deb0c44c25946d198f79f2f00.tar.xz
perf/tool: Make the event parser re-entrant
Make the event parser reentrant by creating separate scanner for each parsing. The scanner is passed to the bison as and argument to the lexer. Signed-off-by: Zheng Yan <zheng.z.yan@intel.com> [ Cleaned up the patch. ] Signed-off-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1339741902-8449-11-git-send-email-zheng.z.yan@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/parse-events.y')
-rw-r--r--tools/perf/util/parse-events.y9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index e533bf72ba9c..2a93d5c8ccda 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -1,6 +1,8 @@
-
+%pure-parser
%name-prefix "parse_events_"
%parse-param {void *_data}
+%parse-param {void *scanner}
+%lex-param {void* scanner}
%{
@@ -11,8 +13,9 @@
#include "types.h"
#include "util.h"
#include "parse-events.h"
+#include "parse-events-bison.h"
-extern int parse_events_lex (void);
+extern int parse_events_lex (YYSTYPE* lvalp, void* scanner);
#define ABORT_ON(val) \
do { \
@@ -286,7 +289,7 @@ sep_slash_dc: '/' | ':' |
%%
-void parse_events_error(void *data __used,
+void parse_events_error(void *data __used, void *scanner __used,
char const *msg __used)
{
}