NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

tcl-lib-nstrace(n) 4.99.30 manual "NaviServer Manual"

Name

tcl-lib-nstrace - Managing Tcl interpreter initialization

Table Of Contents

Description

This file implements set of commands and utilities to manage Tcl interpreter initialization for NaviServer. What all this stuff does is simple: synthesize a Tcl script used to initialize new Tcl interpreters.

There are basically two strategies:

Which one of the above 2 strategies is currently used by the server, is controlled by the lazyloader parameter of the Tcl library, as defined in the server configuration file. The A Strategy is selected by setting the parameter to false. The B Strategy is selected by setting the parameter to true.

In order to influence script generation, users can add their own tracing implementations. Tracers and other supporting callbacks for the following Tcl commands are provided per default:

 load, namespace, variable, proc, rename

For the information of how to add new tracers please look into the source code of already provided callbacks.

Summary of commands

nstrace::enabletrace activates registered Tcl command traces
nstrace::disabletrace terminates tracing of Tcl commands
nstrace::tracescript returns a script for initializing interps
nstrace::enablestate activates generation of the state script
nstrace::disablestate terminates generation of the state script
nstrace::statescript returns a script for initializing interps
nstrace::isactive returns true if tracing Tcl commands is on
nstrace::config setup some configuration options
nstrace::excludensp skip serializing the given namespace
nstrace::namespaces returns list of namespaces for the given parent
nstrace::addtrace registers custom tracer callback
nstrace::addscript registers custom script generator
nstrace::addresolver registers custom command resolver
nstrace::enablecode returns signal about start of tracing
nstrace::disablecode returns signal about stop of tracing
nstrace::addentry adds one entry into the named trace store
nstrace::getentry returns the entry value from the named store
nstrace::delentry removes the entry from the named store
nstrace::getentries returns all entries from the named store

Limitations

  1. [namespace forget] is still not implemented

  2. [namespace origin cmd] breaks if cmd is not already defined

  3. [info procs] does not return list of all cached procedures

See Also

nsd

Keywords

NaviServer, nstrace