blob: 55fab6ad609a8ccdc7f36478dc350bfcb72e5e3f [file] [log] [blame]
Zheng Yanac20de6f2012-06-15 14:31:39 +08001%pure-parser
Jiri Olsa46010ab2012-06-15 14:31:38 +08002%parse-param {void *_data}
Zheng Yanac20de6f2012-06-15 14:31:39 +08003%parse-param {void *scanner}
4%lex-param {void* scanner}
Jiri Olsa89812fc2012-03-15 20:09:15 +01005
6%{
7
8#define YYDEBUG 1
9
10#include <linux/compiler.h>
11#include <linux/list.h>
Borislav Petkovd944c4e2014-04-25 21:31:02 +020012#include <linux/types.h>
Jiri Olsa89812fc2012-03-15 20:09:15 +010013#include "util.h"
14#include "parse-events.h"
Zheng Yanac20de6f2012-06-15 14:31:39 +080015#include "parse-events-bison.h"
Jiri Olsa89812fc2012-03-15 20:09:15 +010016
Zheng Yanac20de6f2012-06-15 14:31:39 +080017extern int parse_events_lex (YYSTYPE* lvalp, void* scanner);
Jiri Olsa89812fc2012-03-15 20:09:15 +010018
19#define ABORT_ON(val) \
20do { \
21 if (val) \
22 YYABORT; \
23} while (0)
24
David Ahernc5cd8ac2013-07-02 13:27:25 -060025#define ALLOC_LIST(list) \
26do { \
27 list = malloc(sizeof(*list)); \
28 ABORT_ON(!list); \
29 INIT_LIST_HEAD(list); \
30} while (0)
31
Namhyung Kim97f63e42013-01-22 18:09:29 +090032static inc_group_count(struct list_head *list,
33 struct parse_events_evlist *data)
34{
35 /* Count groups only have more than 1 members */
36 if (!list_is_last(list->next, list))
37 data->nr_groups++;
38}
39
Jiri Olsa89812fc2012-03-15 20:09:15 +010040%}
41
Jiri Olsa90e2b222012-06-15 14:31:40 +080042%token PE_START_EVENTS PE_START_TERMS
Jiri Olsacf3506d2012-07-04 00:00:43 +020043%token PE_VALUE PE_VALUE_SYM_HW PE_VALUE_SYM_SW PE_RAW PE_TERM
Robert Richterac2ba9f2012-08-16 21:10:21 +020044%token PE_EVENT_NAME
Jiri Olsa89812fc2012-03-15 20:09:15 +010045%token PE_NAME
46%token PE_MODIFIER_EVENT PE_MODIFIER_BP
47%token PE_NAME_CACHE_TYPE PE_NAME_CACHE_OP_RESULT
Jiri Olsa89efb022012-08-08 12:14:14 +020048%token PE_PREFIX_MEM PE_PREFIX_RAW PE_PREFIX_GROUP
Jiri Olsa89812fc2012-03-15 20:09:15 +010049%token PE_ERROR
50%type <num> PE_VALUE
Jiri Olsacf3506d2012-07-04 00:00:43 +020051%type <num> PE_VALUE_SYM_HW
52%type <num> PE_VALUE_SYM_SW
Jiri Olsa89812fc2012-03-15 20:09:15 +010053%type <num> PE_RAW
Jiri Olsa8f707d82012-03-15 20:09:16 +010054%type <num> PE_TERM
Jiri Olsa89812fc2012-03-15 20:09:15 +010055%type <str> PE_NAME
56%type <str> PE_NAME_CACHE_TYPE
57%type <str> PE_NAME_CACHE_OP_RESULT
58%type <str> PE_MODIFIER_EVENT
59%type <str> PE_MODIFIER_BP
Robert Richterac2ba9f2012-08-16 21:10:21 +020060%type <str> PE_EVENT_NAME
Jiri Olsacf3506d2012-07-04 00:00:43 +020061%type <num> value_sym
Jiri Olsa8f707d82012-03-15 20:09:16 +010062%type <head> event_config
63%type <term> event_term
Jiri Olsab847cbd2012-05-21 09:12:51 +020064%type <head> event_pmu
65%type <head> event_legacy_symbol
66%type <head> event_legacy_cache
67%type <head> event_legacy_mem
68%type <head> event_legacy_tracepoint
69%type <head> event_legacy_numeric
70%type <head> event_legacy_raw
71%type <head> event_def
Robert Richterac2ba9f2012-08-16 21:10:21 +020072%type <head> event_mod
73%type <head> event_name
Jiri Olsa89efb022012-08-08 12:14:14 +020074%type <head> event
75%type <head> events
76%type <head> group_def
77%type <head> group
78%type <head> groups
Jiri Olsa89812fc2012-03-15 20:09:15 +010079
80%union
81{
82 char *str;
Robert Richterb527bab2012-08-07 19:43:13 +020083 u64 num;
Jiri Olsa8f707d82012-03-15 20:09:16 +010084 struct list_head *head;
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -030085 struct parse_events_term *term;
Jiri Olsa89812fc2012-03-15 20:09:15 +010086}
87%%
88
Jiri Olsa90e2b222012-06-15 14:31:40 +080089start:
Jiri Olsa89efb022012-08-08 12:14:14 +020090PE_START_EVENTS start_events
Jiri Olsa90e2b222012-06-15 14:31:40 +080091|
Jiri Olsa89efb022012-08-08 12:14:14 +020092PE_START_TERMS start_terms
93
94start_events: groups
95{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -030096 struct parse_events_evlist *data = _data;
Jiri Olsa89efb022012-08-08 12:14:14 +020097
98 parse_events_update_lists($1, &data->list);
99}
100
101groups:
102groups ',' group
103{
104 struct list_head *list = $1;
105 struct list_head *group = $3;
106
107 parse_events_update_lists(group, list);
108 $$ = list;
109}
110|
111groups ',' event
112{
113 struct list_head *list = $1;
114 struct list_head *event = $3;
115
116 parse_events_update_lists(event, list);
117 $$ = list;
118}
119|
120group
121|
122event
123
124group:
125group_def ':' PE_MODIFIER_EVENT
126{
127 struct list_head *list = $1;
128
129 ABORT_ON(parse_events__modifier_group(list, $3));
130 $$ = list;
131}
132|
133group_def
134
135group_def:
136PE_NAME '{' events '}'
137{
138 struct list_head *list = $3;
139
Namhyung Kim97f63e42013-01-22 18:09:29 +0900140 inc_group_count(list, _data);
Arnaldo Carvalho de Melo63dab222012-08-14 16:35:48 -0300141 parse_events__set_leader($1, list);
Jiri Olsa89efb022012-08-08 12:14:14 +0200142 $$ = list;
143}
144|
145'{' events '}'
146{
147 struct list_head *list = $2;
148
Namhyung Kim97f63e42013-01-22 18:09:29 +0900149 inc_group_count(list, _data);
Arnaldo Carvalho de Melo63dab222012-08-14 16:35:48 -0300150 parse_events__set_leader(NULL, list);
Jiri Olsa89efb022012-08-08 12:14:14 +0200151 $$ = list;
152}
Jiri Olsa90e2b222012-06-15 14:31:40 +0800153
Jiri Olsa89812fc2012-03-15 20:09:15 +0100154events:
Jiri Olsa89efb022012-08-08 12:14:14 +0200155events ',' event
156{
157 struct list_head *event = $3;
158 struct list_head *list = $1;
159
160 parse_events_update_lists(event, list);
161 $$ = list;
162}
163|
164event
Jiri Olsa89812fc2012-03-15 20:09:15 +0100165
Robert Richterac2ba9f2012-08-16 21:10:21 +0200166event: event_mod
167
168event_mod:
169event_name PE_MODIFIER_EVENT
Jiri Olsa89812fc2012-03-15 20:09:15 +0100170{
Jiri Olsa89efb022012-08-08 12:14:14 +0200171 struct list_head *list = $1;
Jiri Olsa46010ab2012-06-15 14:31:38 +0800172
Jiri Olsa5d7be902012-03-20 19:15:40 +0100173 /*
174 * Apply modifier on all events added by single event definition
175 * (there could be more events added for multiple tracepoint
176 * definitions via '*?'.
177 */
Jiri Olsaf5b11352012-08-08 12:21:54 +0200178 ABORT_ON(parse_events__modifier_event(list, $2, false));
Jiri Olsa89efb022012-08-08 12:14:14 +0200179 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100180}
181|
Robert Richterac2ba9f2012-08-16 21:10:21 +0200182event_name
183
184event_name:
185PE_EVENT_NAME event_def
186{
187 ABORT_ON(parse_events_name($2, $1));
188 free($1);
189 $$ = $2;
190}
191|
Jiri Olsa89812fc2012-03-15 20:09:15 +0100192event_def
193
Jiri Olsa5f537a22012-03-15 20:09:18 +0100194event_def: event_pmu |
195 event_legacy_symbol |
Jiri Olsa89812fc2012-03-15 20:09:15 +0100196 event_legacy_cache sep_dc |
197 event_legacy_mem |
198 event_legacy_tracepoint sep_dc |
199 event_legacy_numeric sep_dc |
200 event_legacy_raw sep_dc
201
Jiri Olsa5f537a22012-03-15 20:09:18 +0100202event_pmu:
203PE_NAME '/' event_config '/'
204{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300205 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600206 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200207
David Ahernc5cd8ac2013-07-02 13:27:25 -0600208 ALLOC_LIST(list);
209 ABORT_ON(parse_events_add_pmu(list, &data->idx, $1, $3));
Jiri Olsa5f537a22012-03-15 20:09:18 +0100210 parse_events__free_terms($3);
Jiri Olsab847cbd2012-05-21 09:12:51 +0200211 $$ = list;
Jiri Olsa5f537a22012-03-15 20:09:18 +0100212}
Adrian Hunterad962272014-08-15 22:08:40 +0300213|
214PE_NAME '/' '/'
215{
216 struct parse_events_evlist *data = _data;
217 struct list_head *list;
218
219 ALLOC_LIST(list);
220 ABORT_ON(parse_events_add_pmu(list, &data->idx, $1, NULL));
221 $$ = list;
222}
Jiri Olsa5f537a22012-03-15 20:09:18 +0100223
Jiri Olsacf3506d2012-07-04 00:00:43 +0200224value_sym:
225PE_VALUE_SYM_HW
226|
227PE_VALUE_SYM_SW
228
Jiri Olsa89812fc2012-03-15 20:09:15 +0100229event_legacy_symbol:
Jiri Olsacf3506d2012-07-04 00:00:43 +0200230value_sym '/' event_config '/'
Jiri Olsa89812fc2012-03-15 20:09:15 +0100231{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300232 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600233 struct list_head *list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100234 int type = $1 >> 16;
235 int config = $1 & 255;
236
David Ahernc5cd8ac2013-07-02 13:27:25 -0600237 ALLOC_LIST(list);
238 ABORT_ON(parse_events_add_numeric(list, &data->idx,
Jiri Olsa46010ab2012-06-15 14:31:38 +0800239 type, config, $3));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100240 parse_events__free_terms($3);
Jiri Olsab847cbd2012-05-21 09:12:51 +0200241 $$ = list;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100242}
243|
Jiri Olsacf3506d2012-07-04 00:00:43 +0200244value_sym sep_slash_dc
Jiri Olsa8f707d82012-03-15 20:09:16 +0100245{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300246 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600247 struct list_head *list;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100248 int type = $1 >> 16;
249 int config = $1 & 255;
250
David Ahernc5cd8ac2013-07-02 13:27:25 -0600251 ALLOC_LIST(list);
252 ABORT_ON(parse_events_add_numeric(list, &data->idx,
Jiri Olsa46010ab2012-06-15 14:31:38 +0800253 type, config, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200254 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100255}
256
257event_legacy_cache:
258PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT
259{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300260 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600261 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200262
David Ahernc5cd8ac2013-07-02 13:27:25 -0600263 ALLOC_LIST(list);
264 ABORT_ON(parse_events_add_cache(list, &data->idx, $1, $3, $5));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200265 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100266}
267|
268PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT
269{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300270 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600271 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200272
David Ahernc5cd8ac2013-07-02 13:27:25 -0600273 ALLOC_LIST(list);
274 ABORT_ON(parse_events_add_cache(list, &data->idx, $1, $3, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200275 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100276}
277|
278PE_NAME_CACHE_TYPE
279{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300280 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600281 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200282
David Ahernc5cd8ac2013-07-02 13:27:25 -0600283 ALLOC_LIST(list);
284 ABORT_ON(parse_events_add_cache(list, &data->idx, $1, NULL, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200285 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100286}
287
288event_legacy_mem:
289PE_PREFIX_MEM PE_VALUE ':' PE_MODIFIER_BP sep_dc
290{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300291 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600292 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200293
David Ahernc5cd8ac2013-07-02 13:27:25 -0600294 ALLOC_LIST(list);
295 ABORT_ON(parse_events_add_breakpoint(list, &data->idx,
Jiri Olsa46010ab2012-06-15 14:31:38 +0800296 (void *) $2, $4));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200297 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100298}
299|
300PE_PREFIX_MEM PE_VALUE sep_dc
301{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300302 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600303 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200304
David Ahernc5cd8ac2013-07-02 13:27:25 -0600305 ALLOC_LIST(list);
306 ABORT_ON(parse_events_add_breakpoint(list, &data->idx,
Jiri Olsa46010ab2012-06-15 14:31:38 +0800307 (void *) $2, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200308 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100309}
310
311event_legacy_tracepoint:
Alexander Yarygin2b9032e2014-04-25 17:34:05 +0200312PE_NAME '-' PE_NAME ':' PE_NAME
313{
314 struct parse_events_evlist *data = _data;
315 struct list_head *list;
316 char sys_name[128];
317 snprintf(&sys_name, 128, "%s-%s", $1, $3);
318
319 ALLOC_LIST(list);
320 ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
321 $$ = list;
322}
323|
Jiri Olsa89812fc2012-03-15 20:09:15 +0100324PE_NAME ':' PE_NAME
325{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300326 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600327 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200328
David Ahernc5cd8ac2013-07-02 13:27:25 -0600329 ALLOC_LIST(list);
330 ABORT_ON(parse_events_add_tracepoint(list, &data->idx, $1, $3));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200331 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100332}
333
334event_legacy_numeric:
335PE_VALUE ':' PE_VALUE
336{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300337 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600338 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200339
David Ahernc5cd8ac2013-07-02 13:27:25 -0600340 ALLOC_LIST(list);
341 ABORT_ON(parse_events_add_numeric(list, &data->idx, (u32)$1, $3, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200342 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100343}
344
345event_legacy_raw:
346PE_RAW
347{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300348 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600349 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200350
David Ahernc5cd8ac2013-07-02 13:27:25 -0600351 ALLOC_LIST(list);
352 ABORT_ON(parse_events_add_numeric(list, &data->idx,
Jiri Olsa46010ab2012-06-15 14:31:38 +0800353 PERF_TYPE_RAW, $1, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200354 $$ = list;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100355}
356
Jiri Olsa89efb022012-08-08 12:14:14 +0200357start_terms: event_config
Jiri Olsa90e2b222012-06-15 14:31:40 +0800358{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300359 struct parse_events_terms *data = _data;
Jiri Olsa90e2b222012-06-15 14:31:40 +0800360 data->terms = $1;
361}
362
Jiri Olsa8f707d82012-03-15 20:09:16 +0100363event_config:
364event_config ',' event_term
365{
366 struct list_head *head = $1;
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300367 struct parse_events_term *term = $3;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100368
369 ABORT_ON(!head);
370 list_add_tail(&term->list, head);
371 $$ = $1;
372}
373|
374event_term
375{
376 struct list_head *head = malloc(sizeof(*head));
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300377 struct parse_events_term *term = $1;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100378
379 ABORT_ON(!head);
380 INIT_LIST_HEAD(head);
381 list_add_tail(&term->list, head);
382 $$ = head;
383}
384
385event_term:
386PE_NAME '=' PE_NAME
387{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300388 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100389
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300390 ABORT_ON(parse_events_term__str(&term, PARSE_EVENTS__TERM_TYPE_USER,
Jiri Olsa16fa7e82012-04-25 18:24:57 +0200391 $1, $3));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100392 $$ = term;
393}
394|
395PE_NAME '=' PE_VALUE
396{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300397 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100398
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300399 ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
Jiri Olsa16fa7e82012-04-25 18:24:57 +0200400 $1, $3));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100401 $$ = term;
402}
403|
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200404PE_NAME '=' PE_VALUE_SYM_HW
405{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300406 struct parse_events_term *term;
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200407 int config = $3 & 255;
408
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300409 ABORT_ON(parse_events_term__sym_hw(&term, $1, config));
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200410 $$ = term;
411}
412|
Jiri Olsa8f707d82012-03-15 20:09:16 +0100413PE_NAME
414{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300415 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100416
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300417 ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
Jiri Olsa16fa7e82012-04-25 18:24:57 +0200418 $1, 1));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100419 $$ = term;
420}
421|
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200422PE_VALUE_SYM_HW
423{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300424 struct parse_events_term *term;
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200425 int config = $1 & 255;
426
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300427 ABORT_ON(parse_events_term__sym_hw(&term, NULL, config));
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200428 $$ = term;
429}
430|
Jiri Olsa6b5fc392012-05-21 09:12:53 +0200431PE_TERM '=' PE_NAME
432{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300433 struct parse_events_term *term;
Jiri Olsa6b5fc392012-05-21 09:12:53 +0200434
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300435 ABORT_ON(parse_events_term__str(&term, (int)$1, NULL, $3));
Jiri Olsa6b5fc392012-05-21 09:12:53 +0200436 $$ = term;
437}
438|
Jiri Olsa8f707d82012-03-15 20:09:16 +0100439PE_TERM '=' PE_VALUE
440{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300441 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100442
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300443 ABORT_ON(parse_events_term__num(&term, (int)$1, NULL, $3));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100444 $$ = term;
445}
446|
447PE_TERM
448{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300449 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100450
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300451 ABORT_ON(parse_events_term__num(&term, (int)$1, NULL, 1));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100452 $$ = term;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100453}
454
455sep_dc: ':' |
456
Jiri Olsa8f707d82012-03-15 20:09:16 +0100457sep_slash_dc: '/' | ':' |
458
Jiri Olsa89812fc2012-03-15 20:09:15 +0100459%%
460
Irina Tirdea1d037ca2012-09-11 01:15:03 +0300461void parse_events_error(void *data __maybe_unused, void *scanner __maybe_unused,
462 char const *msg __maybe_unused)
Jiri Olsa89812fc2012-03-15 20:09:15 +0100463{
464}