Index: openacs-4/packages/acs-tcl/tcl/tcltrace-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcltrace-init.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-tcl/tcl/tcltrace-init.tcl 13 Jun 2015 20:24:09 -0000 1.1 +++ openacs-4/packages/acs-tcl/tcl/tcltrace-init.tcl 7 Aug 2017 23:48:00 -0000 1.2 @@ -1,17 +1,17 @@ # -# Add Tcl traces for asserted tcl commands. +# Add Tcl traces for asserted Tcl commands. # # Add the traces only, when the functions are active (i.e. the -# controling package parameter has not the default value), because +# controlling package parameter has not the default value), because # adding the traces has performance impact on potentially frequently -# called tcl commands (such as e.g. ns_log) +# called Tcl commands (such as e.g. ns_log) # # Therefore, activating/deactivating requires a server restart. # set trace "" foreach {parameter default cmd} { - TclTraceLogServerities "" {trace add execution ::ns_log enter {::tcltrace::before-ns_log}} - TclTraceSaveNsReturn 0 {trace add execution ::ns_return enter {::tcltrace::before-ns_return}} + TclTraceLogSeverities "" {trace add execution ::ns_log enter {::tcltrace::before-ns_log}} + TclTraceSaveNsReturn 0 {trace add execution ::ns_return enter {::tcltrace::before-ns_return}} } { if {[::parameter::get_from_package_key \ -package_key acs-tcl \ @@ -20,7 +20,24 @@ append trace \n$cmd } } + +# +# Optionally add more traces here +# +set traced_cmds {} +#set traced_cmds {::nsv_get} +#set traced_cmds {::ns_setcookie ::ns_getcookie ::ns_deletecookie} +foreach cmd $traced_cmds { + append trace "\ntrace add execution $cmd enter {::tcltrace::before}" +} + if {$trace ne ""} { ns_ictl trace create $trace } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: