blob: 7a09149df1c7e0eebfff49dd062ffdf92ee5c547 [file] [log] [blame]
Lionel Landwerlin865a47c2017-12-18 23:00:54 +00001TracepointFmt =
2 'name' ':' Space n:PropertyName EndLine
3 { free(v.string); }
4 'ID:' Space v:Number EndLine
5 { yy->ctx.tp->event_id = v.integer; }
6 'format:' EndLine
7 Field+
8 'print fmt:' [^.]* !.
9
10Field = Space (Property ';' Space)+ EndLine
11 { yy->ctx.tp->n_fields++; }
12 | EndLine
13
14Property = 'offset' ':' v:Number
15 { yy->ctx.tp->fields[yy->ctx.tp->n_fields].offset = v.integer; }
16 | 'size' ':' v:Number
17 { yy->ctx.tp->fields[yy->ctx.tp->n_fields].size = v.integer; }
18 | 'signed' ':' v:Number
19 { yy->ctx.tp->fields[yy->ctx.tp->n_fields].is_signed = v.integer != 0; }
20 | 'field' ':' v:PropertyValue
21 { snprintf(yy->ctx.tp->fields[yy->ctx.tp->n_fields].name,
22 sizeof(yy->ctx.tp->fields[yy->ctx.tp->n_fields].name),
23 "%s", strrchr(v.string, ' ') + 1); free(v.string); }
24 | n:PropertyName ':' v:PropertyValue
25 { free(n.string); free(v.string); }
26
27PropertyName = < [A-Za-z0-9_]+ >
28 { $$.string = strdup(yytext); }
29PropertyValue = < [^;]+ >
30 { $$.string = strdup(yytext); }
31Number = < [0-9]+ >
32 { $$.integer = atoi(yytext); }
33
34EndLine = [\n]
35Space = [ \t]*