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