Zheng Yan | ac20de6f | 2012-06-15 14:31:39 +0800 | [diff] [blame] | 1 | %pure-parser |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 2 | %name-prefix "parse_events_" |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 3 | %parse-param {void *_data} |
Zheng Yan | ac20de6f | 2012-06-15 14:31:39 +0800 | [diff] [blame] | 4 | %parse-param {void *scanner} |
| 5 | %lex-param {void* scanner} |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 6 | |
| 7 | %{ |
| 8 | |
| 9 | #define YYDEBUG 1 |
| 10 | |
| 11 | #include <linux/compiler.h> |
| 12 | #include <linux/list.h> |
| 13 | #include "types.h" |
| 14 | #include "util.h" |
| 15 | #include "parse-events.h" |
Zheng Yan | ac20de6f | 2012-06-15 14:31:39 +0800 | [diff] [blame] | 16 | #include "parse-events-bison.h" |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 17 | |
Zheng Yan | ac20de6f | 2012-06-15 14:31:39 +0800 | [diff] [blame] | 18 | extern int parse_events_lex (YYSTYPE* lvalp, void* scanner); |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 19 | |
| 20 | #define ABORT_ON(val) \ |
| 21 | do { \ |
| 22 | if (val) \ |
| 23 | YYABORT; \ |
| 24 | } while (0) |
| 25 | |
| 26 | %} |
| 27 | |
Jiri Olsa | 90e2b22 | 2012-06-15 14:31:40 +0800 | [diff] [blame] | 28 | %token PE_START_EVENTS PE_START_TERMS |
Jiri Olsa | cf3506d | 2012-07-04 00:00:43 +0200 | [diff] [blame] | 29 | %token PE_VALUE PE_VALUE_SYM_HW PE_VALUE_SYM_SW PE_RAW PE_TERM |
Robert Richter | ac2ba9f | 2012-08-16 21:10:21 +0200 | [diff] [blame] | 30 | %token PE_EVENT_NAME |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 31 | %token PE_NAME |
| 32 | %token PE_MODIFIER_EVENT PE_MODIFIER_BP |
| 33 | %token PE_NAME_CACHE_TYPE PE_NAME_CACHE_OP_RESULT |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 34 | %token PE_PREFIX_MEM PE_PREFIX_RAW PE_PREFIX_GROUP |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 35 | %token PE_ERROR |
| 36 | %type <num> PE_VALUE |
Jiri Olsa | cf3506d | 2012-07-04 00:00:43 +0200 | [diff] [blame] | 37 | %type <num> PE_VALUE_SYM_HW |
| 38 | %type <num> PE_VALUE_SYM_SW |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 39 | %type <num> PE_RAW |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 40 | %type <num> PE_TERM |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 41 | %type <str> PE_NAME |
| 42 | %type <str> PE_NAME_CACHE_TYPE |
| 43 | %type <str> PE_NAME_CACHE_OP_RESULT |
| 44 | %type <str> PE_MODIFIER_EVENT |
| 45 | %type <str> PE_MODIFIER_BP |
Robert Richter | ac2ba9f | 2012-08-16 21:10:21 +0200 | [diff] [blame] | 46 | %type <str> PE_EVENT_NAME |
Jiri Olsa | cf3506d | 2012-07-04 00:00:43 +0200 | [diff] [blame] | 47 | %type <num> value_sym |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 48 | %type <head> event_config |
| 49 | %type <term> event_term |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 50 | %type <head> event_pmu |
| 51 | %type <head> event_legacy_symbol |
| 52 | %type <head> event_legacy_cache |
| 53 | %type <head> event_legacy_mem |
| 54 | %type <head> event_legacy_tracepoint |
| 55 | %type <head> event_legacy_numeric |
| 56 | %type <head> event_legacy_raw |
| 57 | %type <head> event_def |
Robert Richter | ac2ba9f | 2012-08-16 21:10:21 +0200 | [diff] [blame] | 58 | %type <head> event_mod |
| 59 | %type <head> event_name |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 60 | %type <head> event |
| 61 | %type <head> events |
| 62 | %type <head> group_def |
| 63 | %type <head> group |
| 64 | %type <head> groups |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 65 | |
| 66 | %union |
| 67 | { |
| 68 | char *str; |
Robert Richter | b527bab | 2012-08-07 19:43:13 +0200 | [diff] [blame] | 69 | u64 num; |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 70 | struct list_head *head; |
| 71 | struct parse_events__term *term; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 72 | } |
| 73 | %% |
| 74 | |
Jiri Olsa | 90e2b22 | 2012-06-15 14:31:40 +0800 | [diff] [blame] | 75 | start: |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 76 | PE_START_EVENTS start_events |
Jiri Olsa | 90e2b22 | 2012-06-15 14:31:40 +0800 | [diff] [blame] | 77 | | |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 78 | PE_START_TERMS start_terms |
| 79 | |
| 80 | start_events: groups |
| 81 | { |
| 82 | struct parse_events_data__events *data = _data; |
| 83 | |
| 84 | parse_events_update_lists($1, &data->list); |
| 85 | } |
| 86 | |
| 87 | groups: |
| 88 | groups ',' group |
| 89 | { |
| 90 | struct list_head *list = $1; |
| 91 | struct list_head *group = $3; |
| 92 | |
| 93 | parse_events_update_lists(group, list); |
| 94 | $$ = list; |
| 95 | } |
| 96 | | |
| 97 | groups ',' event |
| 98 | { |
| 99 | struct list_head *list = $1; |
| 100 | struct list_head *event = $3; |
| 101 | |
| 102 | parse_events_update_lists(event, list); |
| 103 | $$ = list; |
| 104 | } |
| 105 | | |
| 106 | group |
| 107 | | |
| 108 | event |
| 109 | |
| 110 | group: |
| 111 | group_def ':' PE_MODIFIER_EVENT |
| 112 | { |
| 113 | struct list_head *list = $1; |
| 114 | |
| 115 | ABORT_ON(parse_events__modifier_group(list, $3)); |
| 116 | $$ = list; |
| 117 | } |
| 118 | | |
| 119 | group_def |
| 120 | |
| 121 | group_def: |
| 122 | PE_NAME '{' events '}' |
| 123 | { |
| 124 | struct list_head *list = $3; |
| 125 | |
Arnaldo Carvalho de Melo | 63dab22 | 2012-08-14 16:35:48 -0300 | [diff] [blame] | 126 | parse_events__set_leader($1, list); |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 127 | $$ = list; |
| 128 | } |
| 129 | | |
| 130 | '{' events '}' |
| 131 | { |
| 132 | struct list_head *list = $2; |
| 133 | |
Arnaldo Carvalho de Melo | 63dab22 | 2012-08-14 16:35:48 -0300 | [diff] [blame] | 134 | parse_events__set_leader(NULL, list); |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 135 | $$ = list; |
| 136 | } |
Jiri Olsa | 90e2b22 | 2012-06-15 14:31:40 +0800 | [diff] [blame] | 137 | |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 138 | events: |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 139 | events ',' event |
| 140 | { |
| 141 | struct list_head *event = $3; |
| 142 | struct list_head *list = $1; |
| 143 | |
| 144 | parse_events_update_lists(event, list); |
| 145 | $$ = list; |
| 146 | } |
| 147 | | |
| 148 | event |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 149 | |
Robert Richter | ac2ba9f | 2012-08-16 21:10:21 +0200 | [diff] [blame] | 150 | event: event_mod |
| 151 | |
| 152 | event_mod: |
| 153 | event_name PE_MODIFIER_EVENT |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 154 | { |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 155 | struct list_head *list = $1; |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 156 | |
Jiri Olsa | 5d7be90 | 2012-03-20 19:15:40 +0100 | [diff] [blame] | 157 | /* |
| 158 | * Apply modifier on all events added by single event definition |
| 159 | * (there could be more events added for multiple tracepoint |
| 160 | * definitions via '*?'. |
| 161 | */ |
Jiri Olsa | f5b1135 | 2012-08-08 12:21:54 +0200 | [diff] [blame] | 162 | ABORT_ON(parse_events__modifier_event(list, $2, false)); |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 163 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 164 | } |
| 165 | | |
Robert Richter | ac2ba9f | 2012-08-16 21:10:21 +0200 | [diff] [blame] | 166 | event_name |
| 167 | |
| 168 | event_name: |
| 169 | PE_EVENT_NAME event_def |
| 170 | { |
| 171 | ABORT_ON(parse_events_name($2, $1)); |
| 172 | free($1); |
| 173 | $$ = $2; |
| 174 | } |
| 175 | | |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 176 | event_def |
| 177 | |
Jiri Olsa | 5f537a2 | 2012-03-15 20:09:18 +0100 | [diff] [blame] | 178 | event_def: event_pmu | |
| 179 | event_legacy_symbol | |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 180 | event_legacy_cache sep_dc | |
| 181 | event_legacy_mem | |
| 182 | event_legacy_tracepoint sep_dc | |
| 183 | event_legacy_numeric sep_dc | |
| 184 | event_legacy_raw sep_dc |
| 185 | |
Jiri Olsa | 5f537a2 | 2012-03-15 20:09:18 +0100 | [diff] [blame] | 186 | event_pmu: |
| 187 | PE_NAME '/' event_config '/' |
| 188 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 189 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 190 | struct list_head *list = NULL; |
| 191 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 192 | ABORT_ON(parse_events_add_pmu(&list, &data->idx, $1, $3)); |
Jiri Olsa | 5f537a2 | 2012-03-15 20:09:18 +0100 | [diff] [blame] | 193 | parse_events__free_terms($3); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 194 | $$ = list; |
Jiri Olsa | 5f537a2 | 2012-03-15 20:09:18 +0100 | [diff] [blame] | 195 | } |
| 196 | |
Jiri Olsa | cf3506d | 2012-07-04 00:00:43 +0200 | [diff] [blame] | 197 | value_sym: |
| 198 | PE_VALUE_SYM_HW |
| 199 | | |
| 200 | PE_VALUE_SYM_SW |
| 201 | |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 202 | event_legacy_symbol: |
Jiri Olsa | cf3506d | 2012-07-04 00:00:43 +0200 | [diff] [blame] | 203 | value_sym '/' event_config '/' |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 204 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 205 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 206 | struct list_head *list = NULL; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 207 | int type = $1 >> 16; |
| 208 | int config = $1 & 255; |
| 209 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 210 | ABORT_ON(parse_events_add_numeric(&list, &data->idx, |
| 211 | type, config, $3)); |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 212 | parse_events__free_terms($3); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 213 | $$ = list; |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 214 | } |
| 215 | | |
Jiri Olsa | cf3506d | 2012-07-04 00:00:43 +0200 | [diff] [blame] | 216 | value_sym sep_slash_dc |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 217 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 218 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 219 | struct list_head *list = NULL; |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 220 | int type = $1 >> 16; |
| 221 | int config = $1 & 255; |
| 222 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 223 | ABORT_ON(parse_events_add_numeric(&list, &data->idx, |
| 224 | type, config, NULL)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 225 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | event_legacy_cache: |
| 229 | PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT |
| 230 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 231 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 232 | struct list_head *list = NULL; |
| 233 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 234 | ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, $3, $5)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 235 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 236 | } |
| 237 | | |
| 238 | PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT |
| 239 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 240 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 241 | struct list_head *list = NULL; |
| 242 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 243 | ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, $3, NULL)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 244 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 245 | } |
| 246 | | |
| 247 | PE_NAME_CACHE_TYPE |
| 248 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 249 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 250 | struct list_head *list = NULL; |
| 251 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 252 | ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, NULL, NULL)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 253 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 254 | } |
| 255 | |
| 256 | event_legacy_mem: |
| 257 | PE_PREFIX_MEM PE_VALUE ':' PE_MODIFIER_BP sep_dc |
| 258 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 259 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 260 | struct list_head *list = NULL; |
| 261 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 262 | ABORT_ON(parse_events_add_breakpoint(&list, &data->idx, |
| 263 | (void *) $2, $4)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 264 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 265 | } |
| 266 | | |
| 267 | PE_PREFIX_MEM PE_VALUE sep_dc |
| 268 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 269 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 270 | struct list_head *list = NULL; |
| 271 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 272 | ABORT_ON(parse_events_add_breakpoint(&list, &data->idx, |
| 273 | (void *) $2, NULL)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 274 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | event_legacy_tracepoint: |
| 278 | PE_NAME ':' PE_NAME |
| 279 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 280 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 281 | struct list_head *list = NULL; |
| 282 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 283 | ABORT_ON(parse_events_add_tracepoint(&list, &data->idx, $1, $3)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 284 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | event_legacy_numeric: |
| 288 | PE_VALUE ':' PE_VALUE |
| 289 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 290 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 291 | struct list_head *list = NULL; |
| 292 | |
Robert Richter | b527bab | 2012-08-07 19:43:13 +0200 | [diff] [blame] | 293 | ABORT_ON(parse_events_add_numeric(&list, &data->idx, (u32)$1, $3, NULL)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 294 | $$ = list; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 295 | } |
| 296 | |
| 297 | event_legacy_raw: |
| 298 | PE_RAW |
| 299 | { |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 300 | struct parse_events_data__events *data = _data; |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 301 | struct list_head *list = NULL; |
| 302 | |
Jiri Olsa | 46010ab | 2012-06-15 14:31:38 +0800 | [diff] [blame] | 303 | ABORT_ON(parse_events_add_numeric(&list, &data->idx, |
| 304 | PERF_TYPE_RAW, $1, NULL)); |
Jiri Olsa | b847cbd | 2012-05-21 09:12:51 +0200 | [diff] [blame] | 305 | $$ = list; |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 306 | } |
| 307 | |
Jiri Olsa | 89efb02 | 2012-08-08 12:14:14 +0200 | [diff] [blame] | 308 | start_terms: event_config |
Jiri Olsa | 90e2b22 | 2012-06-15 14:31:40 +0800 | [diff] [blame] | 309 | { |
| 310 | struct parse_events_data__terms *data = _data; |
| 311 | data->terms = $1; |
| 312 | } |
| 313 | |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 314 | event_config: |
| 315 | event_config ',' event_term |
| 316 | { |
| 317 | struct list_head *head = $1; |
| 318 | struct parse_events__term *term = $3; |
| 319 | |
| 320 | ABORT_ON(!head); |
| 321 | list_add_tail(&term->list, head); |
| 322 | $$ = $1; |
| 323 | } |
| 324 | | |
| 325 | event_term |
| 326 | { |
| 327 | struct list_head *head = malloc(sizeof(*head)); |
| 328 | struct parse_events__term *term = $1; |
| 329 | |
| 330 | ABORT_ON(!head); |
| 331 | INIT_LIST_HEAD(head); |
| 332 | list_add_tail(&term->list, head); |
| 333 | $$ = head; |
| 334 | } |
| 335 | |
| 336 | event_term: |
| 337 | PE_NAME '=' PE_NAME |
| 338 | { |
| 339 | struct parse_events__term *term; |
| 340 | |
Jiri Olsa | 16fa7e8 | 2012-04-25 18:24:57 +0200 | [diff] [blame] | 341 | ABORT_ON(parse_events__term_str(&term, PARSE_EVENTS__TERM_TYPE_USER, |
| 342 | $1, $3)); |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 343 | $$ = term; |
| 344 | } |
| 345 | | |
| 346 | PE_NAME '=' PE_VALUE |
| 347 | { |
| 348 | struct parse_events__term *term; |
| 349 | |
Jiri Olsa | 16fa7e8 | 2012-04-25 18:24:57 +0200 | [diff] [blame] | 350 | ABORT_ON(parse_events__term_num(&term, PARSE_EVENTS__TERM_TYPE_USER, |
| 351 | $1, $3)); |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 352 | $$ = term; |
| 353 | } |
| 354 | | |
| 355 | PE_NAME |
| 356 | { |
| 357 | struct parse_events__term *term; |
| 358 | |
Jiri Olsa | 16fa7e8 | 2012-04-25 18:24:57 +0200 | [diff] [blame] | 359 | ABORT_ON(parse_events__term_num(&term, PARSE_EVENTS__TERM_TYPE_USER, |
| 360 | $1, 1)); |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 361 | $$ = term; |
| 362 | } |
| 363 | | |
Jiri Olsa | 6b5fc39 | 2012-05-21 09:12:53 +0200 | [diff] [blame] | 364 | PE_TERM '=' PE_NAME |
| 365 | { |
| 366 | struct parse_events__term *term; |
| 367 | |
Robert Richter | b527bab | 2012-08-07 19:43:13 +0200 | [diff] [blame] | 368 | ABORT_ON(parse_events__term_str(&term, (int)$1, NULL, $3)); |
Jiri Olsa | 6b5fc39 | 2012-05-21 09:12:53 +0200 | [diff] [blame] | 369 | $$ = term; |
| 370 | } |
| 371 | | |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 372 | PE_TERM '=' PE_VALUE |
| 373 | { |
| 374 | struct parse_events__term *term; |
| 375 | |
Robert Richter | b527bab | 2012-08-07 19:43:13 +0200 | [diff] [blame] | 376 | ABORT_ON(parse_events__term_num(&term, (int)$1, NULL, $3)); |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 377 | $$ = term; |
| 378 | } |
| 379 | | |
| 380 | PE_TERM |
| 381 | { |
| 382 | struct parse_events__term *term; |
| 383 | |
Robert Richter | b527bab | 2012-08-07 19:43:13 +0200 | [diff] [blame] | 384 | ABORT_ON(parse_events__term_num(&term, (int)$1, NULL, 1)); |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 385 | $$ = term; |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | sep_dc: ':' | |
| 389 | |
Jiri Olsa | 8f707d8 | 2012-03-15 20:09:16 +0100 | [diff] [blame] | 390 | sep_slash_dc: '/' | ':' | |
| 391 | |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 392 | %% |
| 393 | |
Irina Tirdea | 1d037ca | 2012-09-11 01:15:03 +0300 | [diff] [blame] | 394 | void parse_events_error(void *data __maybe_unused, void *scanner __maybe_unused, |
| 395 | char const *msg __maybe_unused) |
Jiri Olsa | 89812fc | 2012-03-15 20:09:15 +0100 | [diff] [blame] | 396 | { |
| 397 | } |