On Oct 2, 2009, at 2:36 PM, Angelo Rajadurai wrote:

You may want to look at speculative tracing. This designed just for this purpose

I'm a bit stumped, though. Consider this script below. I would like to print statistics when the timer fires but it looks like I cannot have commit in that clause since I get errors like

dtrace: failed to compile script reflow-timer.d: line 32: data- recording actions may not follow commit( )

and

dtrace: failed to compile script reflow-timer.d: line 31: commit( ) may not follow data-recording action(s)

Can I have my cake and eat it too? Do I have to put the printing in a separate script?

        Thanks, Joel

---

mozilla$target:::reflow-timer-init
{
  self->init = timestamp;
  self->spec = speculation();
  speculate(self->spec);
printf(">>> reflow timer initialized at %u to fire in %ums\n", self- >init, arg0);
}

pid$target:::entry
/self->spec/
{
  speculate(self->spec);
  printf("%s\n", probefunc);
}

mozilla$target:::reflow-timer-cancel
/self->spec/
{
  discard(self->spec);
  self->spec = 0;
  printf(">>> reflow timer cancelled\n");
}

mozilla$target:::reflow-timer-fire
/self->spec/
{
  self->start = timestamp;
  self->elapsed = self->start - self->init;
  printf(">>> reflow timer fired at %u, after %u.%06ums\n",
    self->start, self->elapsed / 1000000, self->elapsed % 1000000);
  commit(self->spec);
  self->spec = 0;
}

---
fastest mac firefox!
http://wagerlabs.com




_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to