diff options
Diffstat (limited to 'tools/perf/util/parse-events.l')
-rw-r--r-- | tools/perf/util/parse-events.l | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index 44dbc359f0a..ab9eca120fe 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -5,6 +5,7 @@ #include <errno.h> #include "../perf.h" #include "parse-events-bison.h" +#include "parse-events.h" static int __value(char *str, int base, int token) { @@ -41,6 +42,12 @@ static int sym(int type, int config) return PE_VALUE_SYM; } +static int term(int type) +{ + parse_events_lval.num = type; + return PE_TERM; +} + %} num_dec [0-9]+ @@ -85,6 +92,18 @@ speculative-read|speculative-load | refs|Reference|ops|access | misses|miss { return str(PE_NAME_CACHE_OP_RESULT); } + /* + * These are event config hardcoded term names to be specified + * within xxx/.../ syntax. So far we dont clash with other names, + * so we can put them here directly. In case the we have a conflict + * in future, this needs to go into '//' condition block. + */ +config { return term(PARSE_EVENTS__TERM_TYPE_CONFIG); } +config1 { return term(PARSE_EVENTS__TERM_TYPE_CONFIG1); } +config2 { return term(PARSE_EVENTS__TERM_TYPE_CONFIG2); } +period { return term(PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD); } +branch_type { return term(PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE); } + mem: { return PE_PREFIX_MEM; } r{num_raw_hex} { return raw(); } {num_dec} { return value(10); } |