Index: TODO =================================================================== diff -u -r9246ffdfb2716a6abbf3709990abb9c4453eb461 -r4265c280c2d31f281e33fc0cddd9ebdd798ebc06 --- TODO (.../TODO) (revision 9246ffdfb2716a6abbf3709990abb9c4453eb461) +++ TODO (.../TODO) (revision 4265c280c2d31f281e33fc0cddd9ebdd798ebc06) @@ -2416,6 +2416,8 @@ * handle self->tracing in D scripts (and in dtrace/sample.tcl, tests/object-system.tcl) * add probes for object creation and freeing * add sample d-script for object bookkeeping + * renamed object-create into object-alloc (counterpart of object-free, no confusion with create) + * fire probes as well for classes created by the object system - configure * make "configure --help" more pretty Index: dtrace/object-create.d =================================================================== diff -u -r1c4cb273089674161189c6d19deae17fc56334b3 -r4265c280c2d31f281e33fc0cddd9ebdd798ebc06 --- dtrace/object-create.d (.../object-create.d) (revision 1c4cb273089674161189c6d19deae17fc56334b3) +++ dtrace/object-create.d (.../object-create.d) (revision 4265c280c2d31f281e33fc0cddd9ebdd798ebc06) @@ -3,6 +3,6 @@ * check, if every object is freed. */ -nsf*:::object-create { @[copyinstr(arg0)] = sum(1); } +nsf*:::object-alloc { @[copyinstr(arg0)] = sum(1); } nsf*:::object-free { @[copyinstr(arg0)] = sum(-1); } Index: generic/nsf.c =================================================================== diff -u -r1c4cb273089674161189c6d19deae17fc56334b3 -r4265c280c2d31f281e33fc0cddd9ebdd798ebc06 --- generic/nsf.c (.../nsf.c) (revision 1c4cb273089674161189c6d19deae17fc56334b3) +++ generic/nsf.c (.../nsf.c) (revision 4265c280c2d31f281e33fc0cddd9ebdd798ebc06) @@ -14924,6 +14924,11 @@ AddInstance((NsfObject*)thecls, thecls); AddSuper(thecls, theobj); + if (NSF_DTRACE_OBJECT_ALLOC_ENABLED()) { + NSF_DTRACE_OBJECT_ALLOC(ObjectName(((NsfObject*)theobj)), ClassName(((NsfObject*)theobj)->cl)); + NSF_DTRACE_OBJECT_ALLOC(ObjectName(((NsfObject*)thecls)), ClassName(((NsfObject*)thecls)->cl)); + } + return TCL_OK; } @@ -17423,8 +17428,8 @@ nameString); } - if (NSF_DTRACE_OBJECT_CREATE_ENABLED()) { - NSF_DTRACE_OBJECT_CREATE(ObjectName(newObj), ClassName(cl)); + if (NSF_DTRACE_OBJECT_ALLOC_ENABLED()) { + NSF_DTRACE_OBJECT_ALLOC(ObjectName(newObj), ClassName(cl)); } Tcl_SetObjResult(interp, nameObj); Index: generic/nsfDTrace.d =================================================================== diff -u -r1c4cb273089674161189c6d19deae17fc56334b3 -r4265c280c2d31f281e33fc0cddd9ebdd798ebc06 --- generic/nsfDTrace.d (.../nsfDTrace.d) (revision 1c4cb273089674161189c6d19deae17fc56334b3) +++ generic/nsfDTrace.d (.../nsfDTrace.d) (revision 4265c280c2d31f281e33fc0cddd9ebdd798ebc06) @@ -50,12 +50,12 @@ /***************************** Object probes ******************************/ /* - * nsf*:::object-create probe - * triggered when an NSF object creation starts + * nsf*:::object-alloc probe + * triggered when an NSF object is allocated * arg0: object (string) * arg1: class (string) */ - probe object__create(char *object, char *class); + probe object__alloc(char *object, char *class); /* * nsf*:::object-free probe * triggered whean an NSF object is freeed Index: generic/nsfDTrace.h =================================================================== diff -u -r1c4cb273089674161189c6d19deae17fc56334b3 -r4265c280c2d31f281e33fc0cddd9ebdd798ebc06 --- generic/nsfDTrace.h (.../nsfDTrace.h) (revision 1c4cb273089674161189c6d19deae17fc56334b3) +++ generic/nsfDTrace.h (.../nsfDTrace.h) (revision 4265c280c2d31f281e33fc0cddd9ebdd798ebc06) @@ -39,14 +39,14 @@ } while (0) #define NSF_METHOD_RETURN_ENABLED() \ __dtrace_isenabled$nsf$method__return$v1() -#define NSF_OBJECT_CREATE(arg0, arg1) \ +#define NSF_OBJECT_ALLOC(arg0, arg1) \ do { \ __asm__ volatile(".reference " NSF_TYPEDEFS); \ - __dtrace_probe$nsf$object__create$v1$63686172202a$63686172202a(arg0, arg1); \ + __dtrace_probe$nsf$object__alloc$v1$63686172202a$63686172202a(arg0, arg1); \ __asm__ volatile(".reference " NSF_STABILITY); \ } while (0) -#define NSF_OBJECT_CREATE_ENABLED() \ - __dtrace_isenabled$nsf$object__create$v1() +#define NSF_OBJECT_ALLOC_ENABLED() \ + __dtrace_isenabled$nsf$object__alloc$v1() #define NSF_OBJECT_FREE(arg0, arg1) \ do { \ __asm__ volatile(".reference " NSF_TYPEDEFS); \ @@ -63,8 +63,8 @@ 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); extern int __dtrace_isenabled$nsf$method__return$v1(void); -extern void __dtrace_probe$nsf$object__create$v1$63686172202a$63686172202a(char *, char *); -extern int __dtrace_isenabled$nsf$object__create$v1(void); +extern void __dtrace_probe$nsf$object__alloc$v1$63686172202a$63686172202a(char *, char *); +extern int __dtrace_isenabled$nsf$object__alloc$v1(void); extern void __dtrace_probe$nsf$object__free$v1$63686172202a$63686172202a(char *, char *); extern int __dtrace_isenabled$nsf$object__free$v1(void); Index: generic/nsfInt.h =================================================================== diff -u -r1c4cb273089674161189c6d19deae17fc56334b3 -r4265c280c2d31f281e33fc0cddd9ebdd798ebc06 --- generic/nsfInt.h (.../nsfInt.h) (revision 1c4cb273089674161189c6d19deae17fc56334b3) +++ generic/nsfInt.h (.../nsfInt.h) (revision 4265c280c2d31f281e33fc0cddd9ebdd798ebc06) @@ -41,23 +41,23 @@ # 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_OBJECT_CREATE_ENABLED() unlikely(NSF_OBJECT_CREATE_ENABLED()) +# define NSF_DTRACE_OBJECT_ALLOC_ENABLED() unlikely(NSF_OBJECT_FREE_ENABLED()) # define NSF_DTRACE_OBJECT_FREE_ENABLED() unlikely(NSF_OBJECT_FREE_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_OBJECT_CREATE(a0, a1) NSF_OBJECT_CREATE(a0, a1) +# define NSF_DTRACE_OBJECT_ALLOC(a0, a1) NSF_OBJECT_ALLOC(a0, a1) # define NSF_DTRACE_OBJECT_FREE(a0, a1) NSF_OBJECT_FREE(a0, a1) # 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_OBJECT_CREATE_ENABLED() 0 +# define NSF_DTRACE_OBJECT_ALLOC_ENABLED() 0 # define NSF_DTRACE_OBJECT_FREE_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_OBJECT_CREATE(a0, a1) {} +# define NSF_DTRACE_OBJECT_ALLOC(a0, a1) {} # define NSF_DTRACE_OBJECT_FREE(a0, a1) {} # define NSF_DTRACE_CONFIGURE_PROBE(a0, a1) {} #endif