File: tracepoint_format.leg

package info (click to toggle)
intel-gpu-tools 1.22-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 8,408 kB
  • sloc: ansic: 145,957; yacc: 2,780; perl: 1,200; makefile: 878; sh: 525; lex: 487; xml: 404; python: 257
file content (34 lines) | stat: -rw-r--r-- 1,237 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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]*