diff options
author | Zheng Yan <zheng.z.yan@intel.com> | 2012-06-15 02:31:39 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-06-18 06:13:24 -0400 |
commit | ac20de6fff445d6deb0c44c25946d198f79f2f00 (patch) | |
tree | 8d0ec729ea5b5aa8965e46370df50167506b1e61 /tools/perf/util/parse-events.y | |
parent | 46010ab2607aed9484816a8f1679c2ec3c8e7dcf (diff) |
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.y | 9 |
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 @@ | |||
1 | 1 | %pure-parser | |
2 | %name-prefix "parse_events_" | 2 | %name-prefix "parse_events_" |
3 | %parse-param {void *_data} | 3 | %parse-param {void *_data} |
4 | %parse-param {void *scanner} | ||
5 | %lex-param {void* scanner} | ||
4 | 6 | ||
5 | %{ | 7 | %{ |
6 | 8 | ||
@@ -11,8 +13,9 @@ | |||
11 | #include "types.h" | 13 | #include "types.h" |
12 | #include "util.h" | 14 | #include "util.h" |
13 | #include "parse-events.h" | 15 | #include "parse-events.h" |
16 | #include "parse-events-bison.h" | ||
14 | 17 | ||
15 | extern int parse_events_lex (void); | 18 | extern int parse_events_lex (YYSTYPE* lvalp, void* scanner); |
16 | 19 | ||
17 | #define ABORT_ON(val) \ | 20 | #define ABORT_ON(val) \ |
18 | do { \ | 21 | do { \ |
@@ -286,7 +289,7 @@ sep_slash_dc: '/' | ':' | | |||
286 | 289 | ||
287 | %% | 290 | %% |
288 | 291 | ||
289 | void parse_events_error(void *data __used, | 292 | void parse_events_error(void *data __used, void *scanner __used, |
290 | char const *msg __used) | 293 | char const *msg __used) |
291 | { | 294 | { |
292 | } | 295 | } |