Index: dtrace/execution-flow.d =================================================================== diff -u -rb14118b7068e3c1e903b9a516eef0c86101b24d9 -rcbd6b858b9324c125b8b6aad66c85d3482bb8bd4 --- dtrace/execution-flow.d (.../execution-flow.d) (revision b14118b7068e3c1e903b9a516eef0c86101b24d9) +++ dtrace/execution-flow.d (.../execution-flow.d) (revision cbd6b858b9324c125b8b6aad66c85d3482bb8bd4) @@ -1,9 +1,34 @@ -nsf*:::method-entry -{ - printf("%s %s.%s\n", copyinstr(arg0), copyinstr(arg1), copyinstr(arg2)); +/* + * Execution flow trace without arguments + * + * Display execution flow 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*:::method-return -{ - printf("%s %s.%s\n", copyinstr(arg0), copyinstr(arg1), copyinstr(arg2)); -} \ No newline at end of file +nsf*:::configure-probe /self->tracing && copyinstr(arg0) == "dtrace" / { + self->tracing = (arg1 && copyinstr(arg1) == "off") ? 0 : 1; +} + +/* + * Output object, class, method and number of arguments upon method + * invocation. + */ + +nsf*:::method-entry /self->tracing/ { + printf("%s %s.%s (%d)", + copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3); +} + +/* + * Output object, class, method and return code upon method return. + */ +nsf*:::method-return /self->tracing/ { + printf("%s %s.%s -> %d", copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3); +}