]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/dtracy/parse.y
aux/realemu: run cpuproc in same fd group as fileserver
[plan9front.git] / sys / src / cmd / dtracy / parse.y
index 9f231dbc920cc421de7c6aa9fea6804738370ab1..893d6dac3a014e3cc506422186104c4569db2290 100644 (file)
        Type *t;
 }
 
-%type <n> expr
+%type <n> expr optexpr
+%type <sym> optsym
 %type <t> type
+%type <str> probe
 
 %token <sym> TSYM
 %token <num> TNUM
@@ -63,7 +65,9 @@ stats0: stat | stats0 ';' stat
 stat: expr { addstat(STATEXPR, exprcheck($1, 0)); }
 | TPRINT { addstat(STATPRINT); } pelist
 | TPRINTF { addstat(STATPRINTF); } pelist
-
+| '@' optsym '[' expr ']' '=' TSYM '(' optexpr ')' { addstat(STATAGG, $2, $4, $7, $9); }
+optsym: TSYM | { $$ = nil; }
+optexpr: expr | { $$ = nil; }
 
 pelist:
        '(' ')'
@@ -116,8 +120,11 @@ type:
        | TSTRING { $$ = type(TYPSTRING); }
 
 probes:
-       TSYM { addprobe($1->name); }
-       | probes ',' TSYM { addprobe($3->name); }
+       probe { addprobe($1); }
+       | probes ',' probe { addprobe($3); }
 
+probe:
+       TSYM { $$ = $1->name; }
+       | TSTR { $$ = $1; }
 
 %%