]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/dtracy/act.c
aux/realemu: run cpuproc in same fd group as fileserver
[plan9front.git] / sys / src / cmd / dtracy / act.c
index 3412382c3419681e263474c1368291ccefda8349..2159ce19e9e13ae99a87e791f9741ee5e847f2f7 100644 (file)
@@ -41,6 +41,28 @@ mkval(int type, ...)
        return r;
 }
 
+static char *
+insertstars(char *n)
+{
+       Fmt f;
+       int partlen;
+       
+       fmtstrinit(&f);
+       partlen = 0;
+       for(; *n != 0; n++){
+               if(*n == ':'){
+                       if(partlen == 0)
+                               fmtrune(&f, '*');
+                       partlen = 0;
+               }else
+                       partlen++;
+               fmtrune(&f, *n);
+       }
+       if(partlen == 0)
+               fmtrune(&f, '*');
+       return fmtstrflush(&f);
+}
+
 void
 clausebegin(void)
 {
@@ -52,7 +74,7 @@ void
 addprobe(char *s)
 {
        clause->probs = erealloc(clause->probs, sizeof(char *) * (clause->nprob + 1));
-       clause->probs[clause->nprob++] = strdup(s);
+       clause->probs[clause->nprob++] = insertstars(s);
 }
 
 static char *aggtypes[] = {
@@ -170,7 +192,8 @@ prepprintf(Node **arg, int narg, DTActGr *g, int *recoff)
                        goto again;
                case 'x': case 'X': case 'o': case 'b': case 'd':
                        if(n >= narg) sysfatal("printf() too few arguments");
-                       if(arg[n]->typ->type != TYPINT) sysfatal("print() %%%c with non-integer", *fmt);
+                       if(arg[n]->typ->type != TYPINT)
+                               sysfatal("%d: print() %%%c with non-integer", arg[n]->line, *fmt);
                        arg[n] = tracegen(arg[n], g, recoff);
                        n++;
                        fmtrune(&f, 'l');
@@ -179,7 +202,8 @@ prepprintf(Node **arg, int narg, DTActGr *g, int *recoff)
                        break;
                case 's':
                        if(n >= narg) sysfatal("printf() too few arguments");
-                       if(arg[n]->typ->type != TYPSTRING) sysfatal("print() %%s with non-string");
+                       if(arg[n]->typ->type != TYPSTRING)
+                               sysfatal("%d: print() %%s with non-string", arg[n]->line);
                        arg[n] = tracegen(arg[n], g, recoff);
                        n++;
                        fmtrune(&f, *fmt);