Index: generic/gentclAPI.decls =================================================================== diff -u -r19ef72a5f87241def42fa2a2ec15e28a8717b59b -r32b1b0210fbe6c5794d9bfe6def1fda904254ea6 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 19ef72a5f87241def42fa2a2ec15e28a8717b59b) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 32b1b0210fbe6c5794d9bfe6def1fda904254ea6) @@ -35,7 +35,7 @@ {-argName "arg" -required 0 -type tclobj} } nsfCmd configure NsfConfigureCmd { - {-argName "configureoption" -required 1 -type "debug|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"} + {-argName "configureoption" -required 1 -type "debug|dtrace|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"} {-argName "value" -required 0 -type tclobj} } nsfCmd createobjectsystem NsfCreateObjectSystemCmd { Index: generic/nsf.c =================================================================== diff -u -rb14118b7068e3c1e903b9a516eef0c86101b24d9 -r32b1b0210fbe6c5794d9bfe6def1fda904254ea6 --- generic/nsf.c (.../nsf.c) (revision b14118b7068e3c1e903b9a516eef0c86101b24d9) +++ generic/nsf.c (.../nsf.c) (revision 32b1b0210fbe6c5794d9bfe6def1fda904254ea6) @@ -7736,6 +7736,13 @@ Tcl_ObjCmdProc *proc = Tcl_Command_objProc(cmd); int result; + if (NSF_DTRACE_METHOD_ENTRY_ENABLED()) { + NSF_DTRACE_METHOD_ENTRY(ObjectName(object), + cscPtr->cl ? ClassName(cscPtr->cl) : ObjectName(object), + (char *)methodName, + objc-1, (Tcl_Obj **)objv+1); + } + /*fprintf(stderr, "MethodDispatch method '%s' cmd %p cp=%p objc=%d\n", methodName, cmd, cp, objc);*/ assert(object->teardown); @@ -14689,14 +14696,22 @@ /* nsfCmd configure NsfConfigureCmd { - {-argName "configureoption" -required 1 -type "debug|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"} + {-argName "configureoption" -required 1 -type "debug|dtrace|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"} {-argName "value" -required 0 -type tclobj} } */ static int NsfConfigureCmd(Tcl_Interp *interp, int configureoption, Tcl_Obj *valueObj) { int bool; + if (NSF_DTRACE_CONFIGURE_PROBE_ENABLED()) { + /* TODO: opts copied from tclAPI.h; maybe make global value? */ + static CONST char *opts[] = { + "debug", "dtrace", "filter", "profile", "softrecreate", + "objectsystems", "keepinitcmd", "checkresults", "checkarguments", NULL}; + NSF_DTRACE_CONFIGURE_PROBE((char *)opts[configureoption-1], valueObj ? ObjStr(valueObj) : NULL); + } + if (configureoption == ConfigureoptionObjectsystemsIdx) { NsfObjectSystem *osPtr; Tcl_Obj *list = Tcl_NewListObj(0, NULL); Index: generic/nsf.h =================================================================== diff -u -rb14118b7068e3c1e903b9a516eef0c86101b24d9 -r32b1b0210fbe6c5794d9bfe6def1fda904254ea6 --- generic/nsf.h (.../nsf.h) (revision b14118b7068e3c1e903b9a516eef0c86101b24d9) +++ generic/nsf.h (.../nsf.h) (revision 32b1b0210fbe6c5794d9bfe6def1fda904254ea6) @@ -143,7 +143,7 @@ if (cscPtr->cmdPtr && NSF_DTRACE_METHOD_RETURN_ENABLED()) { \ NSF_DTRACE_METHOD_RETURN(ObjectName(cscPtr->self), \ cscPtr->cl ? ClassName(cscPtr->cl) : ObjectName(cscPtr->self), \ - cscPtr->methodName, \ + (char *)cscPtr->methodName, \ retCode); \ } #else Index: generic/nsfDTrace.d =================================================================== diff -u -rb14118b7068e3c1e903b9a516eef0c86101b24d9 -r32b1b0210fbe6c5794d9bfe6def1fda904254ea6 --- generic/nsfDTrace.d (.../nsfDTrace.d) (revision b14118b7068e3c1e903b9a516eef0c86101b24d9) +++ generic/nsfDTrace.d (.../nsfDTrace.d) (revision 32b1b0210fbe6c5794d9bfe6def1fda904254ea6) @@ -71,6 +71,14 @@ */ probe object__destroy(char *class, char *object); + /***************************** nsf configure probe ******************************/ + /* + * nsf*:::configure-probe probe + * triggered when the ::nsf::configure is called + * arg0-arg1: command arguments (strings) + */ + probe configure__probe(char *arg0, char *arg1); + }; /* Index: generic/nsfDTrace.h =================================================================== diff -u -rb14118b7068e3c1e903b9a516eef0c86101b24d9 -r32b1b0210fbe6c5794d9bfe6def1fda904254ea6 --- generic/nsfDTrace.h (.../nsfDTrace.h) (revision b14118b7068e3c1e903b9a516eef0c86101b24d9) +++ generic/nsfDTrace.h (.../nsfDTrace.h) (revision 32b1b0210fbe6c5794d9bfe6def1fda904254ea6) @@ -15,6 +15,14 @@ #define NSF_TYPEDEFS "___dtrace_typedefs$nsf$v2$54636c5f4f626a" +#define NSF_CONFIGURE_PROBE(arg0, arg1) \ +do { \ + __asm__ volatile(".reference " NSF_TYPEDEFS); \ + __dtrace_probe$nsf$configure__probe$v1$63686172202a$63686172202a(arg0, arg1); \ + __asm__ volatile(".reference " NSF_STABILITY); \ +} while (0) +#define NSF_CONFIGURE_PROBE_ENABLED() \ + __dtrace_isenabled$nsf$configure__probe$v1() #define NSF_METHOD_ENTRY(arg0, arg1, arg2, arg3, arg4) \ do { \ __asm__ volatile(".reference " NSF_TYPEDEFS); \ @@ -57,6 +65,8 @@ __dtrace_isenabled$nsf$object__destroy$v1() +extern void __dtrace_probe$nsf$configure__probe$v1$63686172202a$63686172202a(char *, char *); +extern int __dtrace_isenabled$nsf$configure__probe$v1(void); extern void __dtrace_probe$nsf$method__entry$v1$63686172202a$63686172202a$63686172202a$696e74$54636c5f4f626a202a2a(char *, char *, char *, int, Tcl_Obj **); extern int __dtrace_isenabled$nsf$method__entry$v1(void); extern void __dtrace_probe$nsf$method__return$v1$63686172202a$63686172202a$63686172202a$696e74(char *, char *, char *, int); Index: generic/nsfInt.h =================================================================== diff -u -rb14118b7068e3c1e903b9a516eef0c86101b24d9 -r32b1b0210fbe6c5794d9bfe6def1fda904254ea6 --- generic/nsfInt.h (.../nsfInt.h) (revision b14118b7068e3c1e903b9a516eef0c86101b24d9) +++ generic/nsfInt.h (.../nsfInt.h) (revision 32b1b0210fbe6c5794d9bfe6def1fda904254ea6) @@ -41,13 +41,17 @@ # endif # define NSF_DTRACE_METHOD_ENTRY_ENABLED() unlikely(NSF_METHOD_ENTRY_ENABLED()) # define NSF_DTRACE_METHOD_RETURN_ENABLED() unlikely(NSF_METHOD_RETURN_ENABLED()) +# define NSF_DTRACE_CONFIGURE_PROBE_ENABLED() unlikely(NSF_CONFIGURE_PROBE_ENABLED()) # define NSF_DTRACE_METHOD_ENTRY(a0, a1, a2, a3, a4) NSF_METHOD_ENTRY(a0, a1, a2, a3, a4) # define NSF_DTRACE_METHOD_RETURN(a0, a1, a2, a3) NSF_METHOD_RETURN(a0, a1, a2, a3) +# define NSF_DTRACE_CONFIGURE_PROBE(a0, a1) NSF_CONFIGURE_PROBE(a0, a1) #else # define NSF_DTRACE_METHOD_ENTRY_ENABLED() 0 # define NSF_DTRACE_METHOD_RETURN_ENABLED() 0 +# define NSF_DTRACE_CONFIGURE_PROBE_ENABLED() 0 # define NSF_DTRACE_METHOD_ENTRY(a0, a1, a2, a3, a4) {} # define NSF_DTRACE_METHOD_RETURN(a0, a1, a2, a3) {} +# define NSF_DTRACE_CONFIGURE_PROBE(a0, a1) {} #endif Index: generic/nsfStack.c =================================================================== diff -u -rb14118b7068e3c1e903b9a516eef0c86101b24d9 -r32b1b0210fbe6c5794d9bfe6def1fda904254ea6 --- generic/nsfStack.c (.../nsfStack.c) (revision b14118b7068e3c1e903b9a516eef0c86101b24d9) +++ generic/nsfStack.c (.../nsfStack.c) (revision 32b1b0210fbe6c5794d9bfe6def1fda904254ea6) @@ -830,13 +830,6 @@ * cases, we maintain an activation count. */ if (cmd) { - if (NSF_DTRACE_METHOD_ENTRY_ENABLED()) { - // TODO: missing arg list - NSF_DTRACE_METHOD_ENTRY(ObjectName(object), - cl ? ClassName(cl) : ObjectName(object), - Tcl_GetCommandName(object->teardown,cmd), - 0, ""); - } /* * Track object activations */ Index: generic/tclAPI.h =================================================================== diff -u -r19ef72a5f87241def42fa2a2ec15e28a8717b59b -r32b1b0210fbe6c5794d9bfe6def1fda904254ea6 --- generic/tclAPI.h (.../tclAPI.h) (revision 19ef72a5f87241def42fa2a2ec15e28a8717b59b) +++ generic/tclAPI.h (.../tclAPI.h) (revision 32b1b0210fbe6c5794d9bfe6def1fda904254ea6) @@ -85,12 +85,12 @@ return result; } -enum ConfigureoptionIdx {ConfigureoptionNULL, ConfigureoptionDebugIdx, ConfigureoptionFilterIdx, ConfigureoptionProfileIdx, ConfigureoptionSoftrecreateIdx, ConfigureoptionObjectsystemsIdx, ConfigureoptionKeepinitcmdIdx, ConfigureoptionCheckresultsIdx, ConfigureoptionCheckargumentsIdx}; +enum ConfigureoptionIdx {ConfigureoptionNULL, ConfigureoptionDebugIdx, ConfigureoptionDtraceIdx, ConfigureoptionFilterIdx, ConfigureoptionProfileIdx, ConfigureoptionSoftrecreateIdx, ConfigureoptionObjectsystemsIdx, ConfigureoptionKeepinitcmdIdx, ConfigureoptionCheckresultsIdx, ConfigureoptionCheckargumentsIdx}; static int ConvertToConfigureoption(Tcl_Interp *interp, Tcl_Obj *objPtr, NsfParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static CONST char *opts[] = {"debug", "filter", "profile", "softrecreate", "objectsystems", "keepinitcmd", "checkresults", "checkarguments", NULL}; + static CONST char *opts[] = {"debug", "dtrace", "filter", "profile", "softrecreate", "objectsystems", "keepinitcmd", "checkresults", "checkarguments", NULL}; (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "configureoption", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); @@ -175,7 +175,7 @@ {ConvertToMethodproperty, "class-only|call-protected|redefine-protected|returns|slotcontainer|slotobj"}, {ConvertToRelationtype, "object-mixin|class-mixin|object-filter|class-filter|class|superclass|rootclass"}, {ConvertToSource, "all|application|baseclasses"}, - {ConvertToConfigureoption, "debug|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"}, + {ConvertToConfigureoption, "debug|dtrace|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"}, {ConvertToAssertionsubcmd, "check|object-invar|class-invar"}, {NULL, NULL} };