blob: 72def077dbbfda149dfe893135dd3940ca2ed648 [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
Kan Liangba32a452014-10-07 11:08:51 -040050%token PE_PMU_EVENT_PRE PE_PMU_EVENT_SUF PE_KERNEL_PMU_EVENT
Jiri Olsa89812fc2012-03-15 20:09:15 +010051%type <num> PE_VALUE
Jiri Olsacf3506d2012-07-04 00:00:43 +020052%type <num> PE_VALUE_SYM_HW
53%type <num> PE_VALUE_SYM_SW
Jiri Olsa89812fc2012-03-15 20:09:15 +010054%type <num> PE_RAW
Jiri Olsa8f707d82012-03-15 20:09:16 +010055%type <num> PE_TERM
Jiri Olsa89812fc2012-03-15 20:09:15 +010056%type <str> PE_NAME
57%type <str> PE_NAME_CACHE_TYPE
58%type <str> PE_NAME_CACHE_OP_RESULT
59%type <str> PE_MODIFIER_EVENT
60%type <str> PE_MODIFIER_BP
Robert Richterac2ba9f2012-08-16 21:10:21 +020061%type <str> PE_EVENT_NAME
Kan Liangba32a452014-10-07 11:08:51 -040062%type <str> PE_PMU_EVENT_PRE PE_PMU_EVENT_SUF PE_KERNEL_PMU_EVENT
Jiri Olsacf3506d2012-07-04 00:00:43 +020063%type <num> value_sym
Jiri Olsa8f707d82012-03-15 20:09:16 +010064%type <head> event_config
65%type <term> event_term
Jiri Olsab847cbd2012-05-21 09:12:51 +020066%type <head> event_pmu
67%type <head> event_legacy_symbol
68%type <head> event_legacy_cache
69%type <head> event_legacy_mem
70%type <head> event_legacy_tracepoint
71%type <head> event_legacy_numeric
72%type <head> event_legacy_raw
73%type <head> event_def
Robert Richterac2ba9f2012-08-16 21:10:21 +020074%type <head> event_mod
75%type <head> event_name
Jiri Olsa89efb022012-08-08 12:14:14 +020076%type <head> event
77%type <head> events
78%type <head> group_def
79%type <head> group
80%type <head> groups
Jiri Olsa89812fc2012-03-15 20:09:15 +010081
82%union
83{
84 char *str;
Robert Richterb527bab2012-08-07 19:43:13 +020085 u64 num;
Jiri Olsa8f707d82012-03-15 20:09:16 +010086 struct list_head *head;
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -030087 struct parse_events_term *term;
Jiri Olsa89812fc2012-03-15 20:09:15 +010088}
89%%
90
Jiri Olsa90e2b222012-06-15 14:31:40 +080091start:
Jiri Olsa89efb022012-08-08 12:14:14 +020092PE_START_EVENTS start_events
Jiri Olsa90e2b222012-06-15 14:31:40 +080093|
Jiri Olsa89efb022012-08-08 12:14:14 +020094PE_START_TERMS start_terms
95
96start_events: groups
97{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -030098 struct parse_events_evlist *data = _data;
Jiri Olsa89efb022012-08-08 12:14:14 +020099
100 parse_events_update_lists($1, &data->list);
101}
102
103groups:
104groups ',' group
105{
106 struct list_head *list = $1;
107 struct list_head *group = $3;
108
109 parse_events_update_lists(group, list);
110 $$ = list;
111}
112|
113groups ',' event
114{
115 struct list_head *list = $1;
116 struct list_head *event = $3;
117
118 parse_events_update_lists(event, list);
119 $$ = list;
120}
121|
122group
123|
124event
125
126group:
127group_def ':' PE_MODIFIER_EVENT
128{
129 struct list_head *list = $1;
130
131 ABORT_ON(parse_events__modifier_group(list, $3));
132 $$ = list;
133}
134|
135group_def
136
137group_def:
138PE_NAME '{' events '}'
139{
140 struct list_head *list = $3;
141
Namhyung Kim97f63e42013-01-22 18:09:29 +0900142 inc_group_count(list, _data);
Arnaldo Carvalho de Melo63dab222012-08-14 16:35:48 -0300143 parse_events__set_leader($1, list);
Jiri Olsa89efb022012-08-08 12:14:14 +0200144 $$ = list;
145}
146|
147'{' events '}'
148{
149 struct list_head *list = $2;
150
Namhyung Kim97f63e42013-01-22 18:09:29 +0900151 inc_group_count(list, _data);
Arnaldo Carvalho de Melo63dab222012-08-14 16:35:48 -0300152 parse_events__set_leader(NULL, list);
Jiri Olsa89efb022012-08-08 12:14:14 +0200153 $$ = list;
154}
Jiri Olsa90e2b222012-06-15 14:31:40 +0800155
Jiri Olsa89812fc2012-03-15 20:09:15 +0100156events:
Jiri Olsa89efb022012-08-08 12:14:14 +0200157events ',' event
158{
159 struct list_head *event = $3;
160 struct list_head *list = $1;
161
162 parse_events_update_lists(event, list);
163 $$ = list;
164}
165|
166event
Jiri Olsa89812fc2012-03-15 20:09:15 +0100167
Robert Richterac2ba9f2012-08-16 21:10:21 +0200168event: event_mod
169
170event_mod:
171event_name PE_MODIFIER_EVENT
Jiri Olsa89812fc2012-03-15 20:09:15 +0100172{
Jiri Olsa89efb022012-08-08 12:14:14 +0200173 struct list_head *list = $1;
Jiri Olsa46010ab2012-06-15 14:31:38 +0800174
Jiri Olsa5d7be902012-03-20 19:15:40 +0100175 /*
176 * Apply modifier on all events added by single event definition
177 * (there could be more events added for multiple tracepoint
178 * definitions via '*?'.
179 */
Jiri Olsaf5b11352012-08-08 12:21:54 +0200180 ABORT_ON(parse_events__modifier_event(list, $2, false));
Jiri Olsa89efb022012-08-08 12:14:14 +0200181 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100182}
183|
Robert Richterac2ba9f2012-08-16 21:10:21 +0200184event_name
185
186event_name:
187PE_EVENT_NAME event_def
188{
189 ABORT_ON(parse_events_name($2, $1));
190 free($1);
191 $$ = $2;
192}
193|
Jiri Olsa89812fc2012-03-15 20:09:15 +0100194event_def
195
Jiri Olsa5f537a22012-03-15 20:09:18 +0100196event_def: event_pmu |
197 event_legacy_symbol |
Jiri Olsa89812fc2012-03-15 20:09:15 +0100198 event_legacy_cache sep_dc |
199 event_legacy_mem |
200 event_legacy_tracepoint sep_dc |
201 event_legacy_numeric sep_dc |
202 event_legacy_raw sep_dc
203
Jiri Olsa5f537a22012-03-15 20:09:18 +0100204event_pmu:
205PE_NAME '/' event_config '/'
206{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300207 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600208 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200209
David Ahernc5cd8ac2013-07-02 13:27:25 -0600210 ALLOC_LIST(list);
211 ABORT_ON(parse_events_add_pmu(list, &data->idx, $1, $3));
Jiri Olsa5f537a22012-03-15 20:09:18 +0100212 parse_events__free_terms($3);
Jiri Olsab847cbd2012-05-21 09:12:51 +0200213 $$ = list;
Jiri Olsa5f537a22012-03-15 20:09:18 +0100214}
Adrian Hunterad962272014-08-15 22:08:40 +0300215|
216PE_NAME '/' '/'
217{
218 struct parse_events_evlist *data = _data;
219 struct list_head *list;
220
221 ALLOC_LIST(list);
222 ABORT_ON(parse_events_add_pmu(list, &data->idx, $1, NULL));
223 $$ = list;
224}
Kan Liangba32a452014-10-07 11:08:51 -0400225|
226PE_KERNEL_PMU_EVENT sep_dc
227{
228 struct parse_events_evlist *data = _data;
229 struct list_head *head;
230 struct parse_events_term *term;
231 struct list_head *list;
232
233 ALLOC_LIST(head);
234 ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
235 $1, 1));
236 list_add_tail(&term->list, head);
237
238 ALLOC_LIST(list);
239 ABORT_ON(parse_events_add_pmu(list, &data->idx, "cpu", head));
240 parse_events__free_terms(head);
241 $$ = list;
242}
243|
244PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc
245{
246 struct parse_events_evlist *data = _data;
247 struct list_head *head;
248 struct parse_events_term *term;
249 struct list_head *list;
250 char pmu_name[128];
251 snprintf(&pmu_name, 128, "%s-%s", $1, $3);
252
253 ALLOC_LIST(head);
254 ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
255 &pmu_name, 1));
256 list_add_tail(&term->list, head);
257
258 ALLOC_LIST(list);
259 ABORT_ON(parse_events_add_pmu(list, &data->idx, "cpu", head));
260 parse_events__free_terms(head);
261 $$ = list;
262}
Jiri Olsa5f537a22012-03-15 20:09:18 +0100263
Jiri Olsacf3506d2012-07-04 00:00:43 +0200264value_sym:
265PE_VALUE_SYM_HW
266|
267PE_VALUE_SYM_SW
268
Jiri Olsa89812fc2012-03-15 20:09:15 +0100269event_legacy_symbol:
Jiri Olsacf3506d2012-07-04 00:00:43 +0200270value_sym '/' event_config '/'
Jiri Olsa89812fc2012-03-15 20:09:15 +0100271{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300272 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600273 struct list_head *list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100274 int type = $1 >> 16;
275 int config = $1 & 255;
276
David Ahernc5cd8ac2013-07-02 13:27:25 -0600277 ALLOC_LIST(list);
278 ABORT_ON(parse_events_add_numeric(list, &data->idx,
Jiri Olsa46010ab2012-06-15 14:31:38 +0800279 type, config, $3));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100280 parse_events__free_terms($3);
Jiri Olsab847cbd2012-05-21 09:12:51 +0200281 $$ = list;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100282}
283|
Jiri Olsacf3506d2012-07-04 00:00:43 +0200284value_sym sep_slash_dc
Jiri Olsa8f707d82012-03-15 20:09:16 +0100285{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300286 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600287 struct list_head *list;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100288 int type = $1 >> 16;
289 int config = $1 & 255;
290
David Ahernc5cd8ac2013-07-02 13:27:25 -0600291 ALLOC_LIST(list);
292 ABORT_ON(parse_events_add_numeric(list, &data->idx,
Jiri Olsa46010ab2012-06-15 14:31:38 +0800293 type, config, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200294 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100295}
296
297event_legacy_cache:
298PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT
299{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300300 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600301 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200302
David Ahernc5cd8ac2013-07-02 13:27:25 -0600303 ALLOC_LIST(list);
304 ABORT_ON(parse_events_add_cache(list, &data->idx, $1, $3, $5));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200305 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100306}
307|
308PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT
309{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300310 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600311 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200312
David Ahernc5cd8ac2013-07-02 13:27:25 -0600313 ALLOC_LIST(list);
314 ABORT_ON(parse_events_add_cache(list, &data->idx, $1, $3, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200315 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100316}
317|
318PE_NAME_CACHE_TYPE
319{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300320 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600321 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200322
David Ahernc5cd8ac2013-07-02 13:27:25 -0600323 ALLOC_LIST(list);
324 ABORT_ON(parse_events_add_cache(list, &data->idx, $1, NULL, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200325 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100326}
327
328event_legacy_mem:
Jacob Shin3741eb92014-05-29 17:26:51 +0200329PE_PREFIX_MEM PE_VALUE '/' PE_VALUE ':' PE_MODIFIER_BP sep_dc
330{
331 struct parse_events_evlist *data = _data;
332 struct list_head *list;
333
334 ALLOC_LIST(list);
335 ABORT_ON(parse_events_add_breakpoint(list, &data->idx,
336 (void *) $2, $6, $4));
337 $$ = list;
338}
339|
340PE_PREFIX_MEM PE_VALUE '/' PE_VALUE sep_dc
341{
342 struct parse_events_evlist *data = _data;
343 struct list_head *list;
344
345 ALLOC_LIST(list);
346 ABORT_ON(parse_events_add_breakpoint(list, &data->idx,
347 (void *) $2, NULL, $4));
348 $$ = list;
349}
350|
Jiri Olsa89812fc2012-03-15 20:09:15 +0100351PE_PREFIX_MEM PE_VALUE ':' PE_MODIFIER_BP sep_dc
352{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300353 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600354 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200355
David Ahernc5cd8ac2013-07-02 13:27:25 -0600356 ALLOC_LIST(list);
357 ABORT_ON(parse_events_add_breakpoint(list, &data->idx,
Jacob Shin3741eb92014-05-29 17:26:51 +0200358 (void *) $2, $4, 0));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200359 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100360}
361|
362PE_PREFIX_MEM PE_VALUE sep_dc
363{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300364 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600365 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200366
David Ahernc5cd8ac2013-07-02 13:27:25 -0600367 ALLOC_LIST(list);
368 ABORT_ON(parse_events_add_breakpoint(list, &data->idx,
Jacob Shin3741eb92014-05-29 17:26:51 +0200369 (void *) $2, NULL, 0));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200370 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100371}
372
373event_legacy_tracepoint:
Alexander Yarygin2b9032e2014-04-25 17:34:05 +0200374PE_NAME '-' PE_NAME ':' PE_NAME
375{
376 struct parse_events_evlist *data = _data;
377 struct list_head *list;
378 char sys_name[128];
379 snprintf(&sys_name, 128, "%s-%s", $1, $3);
380
381 ALLOC_LIST(list);
382 ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
383 $$ = list;
384}
385|
Jiri Olsa89812fc2012-03-15 20:09:15 +0100386PE_NAME ':' PE_NAME
387{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300388 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600389 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200390
David Ahernc5cd8ac2013-07-02 13:27:25 -0600391 ALLOC_LIST(list);
392 ABORT_ON(parse_events_add_tracepoint(list, &data->idx, $1, $3));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200393 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100394}
395
396event_legacy_numeric:
397PE_VALUE ':' PE_VALUE
398{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300399 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600400 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200401
David Ahernc5cd8ac2013-07-02 13:27:25 -0600402 ALLOC_LIST(list);
403 ABORT_ON(parse_events_add_numeric(list, &data->idx, (u32)$1, $3, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200404 $$ = list;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100405}
406
407event_legacy_raw:
408PE_RAW
409{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300410 struct parse_events_evlist *data = _data;
David Ahernc5cd8ac2013-07-02 13:27:25 -0600411 struct list_head *list;
Jiri Olsab847cbd2012-05-21 09:12:51 +0200412
David Ahernc5cd8ac2013-07-02 13:27:25 -0600413 ALLOC_LIST(list);
414 ABORT_ON(parse_events_add_numeric(list, &data->idx,
Jiri Olsa46010ab2012-06-15 14:31:38 +0800415 PERF_TYPE_RAW, $1, NULL));
Jiri Olsab847cbd2012-05-21 09:12:51 +0200416 $$ = list;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100417}
418
Jiri Olsa89efb022012-08-08 12:14:14 +0200419start_terms: event_config
Jiri Olsa90e2b222012-06-15 14:31:40 +0800420{
Arnaldo Carvalho de Melo23b63392013-01-18 16:56:57 -0300421 struct parse_events_terms *data = _data;
Jiri Olsa90e2b222012-06-15 14:31:40 +0800422 data->terms = $1;
423}
424
Jiri Olsa8f707d82012-03-15 20:09:16 +0100425event_config:
426event_config ',' event_term
427{
428 struct list_head *head = $1;
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300429 struct parse_events_term *term = $3;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100430
431 ABORT_ON(!head);
432 list_add_tail(&term->list, head);
433 $$ = $1;
434}
435|
436event_term
437{
438 struct list_head *head = malloc(sizeof(*head));
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300439 struct parse_events_term *term = $1;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100440
441 ABORT_ON(!head);
442 INIT_LIST_HEAD(head);
443 list_add_tail(&term->list, head);
444 $$ = head;
445}
446
447event_term:
448PE_NAME '=' PE_NAME
449{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300450 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100451
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300452 ABORT_ON(parse_events_term__str(&term, PARSE_EVENTS__TERM_TYPE_USER,
Jiri Olsa16fa7e82012-04-25 18:24:57 +0200453 $1, $3));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100454 $$ = term;
455}
456|
457PE_NAME '=' PE_VALUE
458{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300459 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100460
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300461 ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
Jiri Olsa16fa7e82012-04-25 18:24:57 +0200462 $1, $3));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100463 $$ = term;
464}
465|
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200466PE_NAME '=' PE_VALUE_SYM_HW
467{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300468 struct parse_events_term *term;
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200469 int config = $3 & 255;
470
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300471 ABORT_ON(parse_events_term__sym_hw(&term, $1, config));
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200472 $$ = term;
473}
474|
Jiri Olsa8f707d82012-03-15 20:09:16 +0100475PE_NAME
476{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300477 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100478
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300479 ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER,
Jiri Olsa16fa7e82012-04-25 18:24:57 +0200480 $1, 1));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100481 $$ = term;
482}
483|
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200484PE_VALUE_SYM_HW
485{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300486 struct parse_events_term *term;
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200487 int config = $1 & 255;
488
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300489 ABORT_ON(parse_events_term__sym_hw(&term, NULL, config));
Jiri Olsa1d33d6d2012-10-10 14:53:17 +0200490 $$ = term;
491}
492|
Jiri Olsa6b5fc392012-05-21 09:12:53 +0200493PE_TERM '=' PE_NAME
494{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300495 struct parse_events_term *term;
Jiri Olsa6b5fc392012-05-21 09:12:53 +0200496
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300497 ABORT_ON(parse_events_term__str(&term, (int)$1, NULL, $3));
Jiri Olsa6b5fc392012-05-21 09:12:53 +0200498 $$ = term;
499}
500|
Jiri Olsa8f707d82012-03-15 20:09:16 +0100501PE_TERM '=' PE_VALUE
502{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300503 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100504
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300505 ABORT_ON(parse_events_term__num(&term, (int)$1, NULL, $3));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100506 $$ = term;
507}
508|
509PE_TERM
510{
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300511 struct parse_events_term *term;
Jiri Olsa8f707d82012-03-15 20:09:16 +0100512
Arnaldo Carvalho de Melo6cee6cd2013-01-18 16:29:49 -0300513 ABORT_ON(parse_events_term__num(&term, (int)$1, NULL, 1));
Jiri Olsa8f707d82012-03-15 20:09:16 +0100514 $$ = term;
Jiri Olsa89812fc2012-03-15 20:09:15 +0100515}
516
517sep_dc: ':' |
518
Jiri Olsa8f707d82012-03-15 20:09:16 +0100519sep_slash_dc: '/' | ':' |
520
Jiri Olsa89812fc2012-03-15 20:09:15 +0100521%%
522
Irina Tirdea1d037ca2012-09-11 01:15:03 +0300523void parse_events_error(void *data __maybe_unused, void *scanner __maybe_unused,
524 char const *msg __maybe_unused)
Jiri Olsa89812fc2012-03-15 20:09:15 +0100525{
526}