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
|
/* -*- D -*-
*
* Quantize time between method-entry and method-returns for calls on ::nx::Object
*
* Activate tracing between
* ::nsf::configure dtrace on
* and
* ::nsf::configure dtrace off
*
*/
nsf*:::configure-probe /!self->tracing && copyinstr(arg0) == "dtrace" / {
self->tracing = (arg1 && copyinstr(arg1) == "on") ? 1 : 0;
}
nsf*:::configure-probe /self->tracing && copyinstr(arg0) == "dtrace" / {
self->tracing = (arg1 && copyinstr(arg1) == "off") ? 0 : 1;
}
/*
* Measure time differences
*/
nsf*:::method-entry /self->tracing && copyinstr(arg1) == "::nx::Object"/ {
self->start = timestamp;
}
nsf*:::method-return /self->tracing && copyinstr(arg1) == "::nx::Object" && self->start/ {
@[copyinstr(arg1), copyinstr(arg2)] = quantize(timestamp - self->start);
self->start = 0;
}
|