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>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user