You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
TracepointFmt =
|
|
'name' ':' Space n:PropertyName EndLine { free(n.string); }
|
|
'ID:' Space v:Number EndLine { yy->ctx.tp->event_id = v.integer; }
|
|
'format:' EndLine
|
|
Field+
|
|
'print fmt:' [^.]* !.
|
|
|
|
Field = Space (Property ';' Space)+ EndLine
|
|
{ yy->ctx.tp->n_fields++; }
|
|
| EndLine
|
|
|
|
Property = 'offset' ':' v:Number
|
|
{ yy->ctx.tp->fields[yy->ctx.tp->n_fields].offset = v.integer; }
|
|
| 'size' ':' v:Number
|
|
{ yy->ctx.tp->fields[yy->ctx.tp->n_fields].size = v.integer; }
|
|
| 'signed' ':' v:Number
|
|
{ yy->ctx.tp->fields[yy->ctx.tp->n_fields].is_signed = v.integer != 0; }
|
|
| 'field' ':' v:PropertyValue
|
|
{ snprintf(yy->ctx.tp->fields[yy->ctx.tp->n_fields].name,
|
|
sizeof(yy->ctx.tp->fields[yy->ctx.tp->n_fields].name),
|
|
"%s", strrchr(v.string, ' ') + 1);
|
|
free(v.string); }
|
|
| n:PropertyName ':' v:PropertyValue
|
|
{ free(n.string); free(v.string); }
|
|
|
|
PropertyName = < [A-Za-z0-9_]+ >
|
|
{ $$.string = strdup(yytext); }
|
|
PropertyValue = < [^;]+ >
|
|
{ $$.string = strdup(yytext); }
|
|
Number = < [0-9]+ >
|
|
{ $$.integer = atoi(yytext); }
|
|
|
|
EndLine = [\n]
|
|
Space = [ \t]*
|