• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1TracepointFmt =
2    'name' ':' Space n:PropertyName EndLine { free(n.string); }
3    'ID:' Space v:Number EndLine { yy->ctx.tp->event_id = v.integer; }
4    'format:' EndLine
5    Field+
6    'print fmt:' [^.]* !.
7
8Field = Space (Property ';' Space)+ EndLine
9            { yy->ctx.tp->n_fields++; }
10      | EndLine
11
12Property = '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); }
25
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]*
35