This class provides a visual editor specialized for profiling the execution of tcl and tcl code. The profiler is derived from the EditForest class, and therefore inherits all of its features.
The Tycho Programmer's Manual includes a section on Performance in Tcl.
profile
command. TclX
is an extension to Tcl. The TclX sources are available at ftp://ftp.neosoft.com/pub/tcl/tclx-distrib
.
To use the Profile Tcl tool, you must have the TclX profile
command available at runtime.
When the Profiler is started, the Tycho Loader
will look for the TclX shared library that contains the
profile
command and attempt to load it.
To use the Profiler, you must have the profile
command.
There are several different scenarios, pick the scenario that fits
you situations best and follow the instructions below.
The profile
command shipped with TclX7.6.0 has
a bug that causes coredumps if used with Itcl.
The file tclXprofile.c.patch
is a
patch to tclX7.6.0/tcl/generic/tclXprofile.c
that
fixes the bug.
To install this patch, you will need Larry Wall's
patch
program. (You can get patch
from ftp://ptolemy.eecs.berkeley.edu/pub/gnu/src/patch-2.1.tar.gz
).
To install the patch
ftp://ftp.neosoft.com/pub/tcl/tclx-distrib
.
cd
to
tclX
version/tcl/generic
.
tclXprofile.c
patch <
$TYCHO/editors/visedit/doc/usersGuides/tclXprofile.c.patch
.
$TYCHO/lib/profile
contains a standalone
version of tclXprofile.c
that can be configured and
compiled to produced a shared object that can be loaded in to Tycho
when profiling starts. The Tycho Loader facility will bring up a file
browser if TclX cannot be found, and you can enter the pathname of the
tclXprofile
object.
Compiling tclXprofile.c
requires the tcl sources, since
the .c file uses tclInt.h
, which is not usually
installed. If you are compiling tclXprofile.c
from
within Ptolemy, then you can use the default settings in
$TYCHO/lib/profile/makefile
. If you are not compiling
from within Ptolemy, you will have to set the
TCL_SRC_INCLUDE_DIR
makefile variable.
Compiling tclXprofile.c
also requires
tclConfig.sh
, which is usually in the architecture
dependent tcl lib
directory. Again, if you are
installing from within Ptolemy, then the makefile is probably fine.
Otherwise you will have to adjust the TCLCONFIGSH
makefile variable.
There are two ways to adjust these variables:
$TYCHO/lib/profile/makefile
After you have adjusted the makefile accordingly, configure and build
the shared object:
cd $TYCHO/lib/profile; make
cd $TYCHO/lib/profile make TCL_SRC_INCLUDE_DIR=$PTOLEMY/src/tcltk/itcl2.1/tcl7.5/generic/ \ $PTOLEMY/tcltk/itcl.$PTARCH/lib/itcl/tclConfig.sh
tclXprofile
shared object will be in
$TYCHO/lib/profile/$PTARCH
. Under solaris, the file will
be named tclXprofile.so
.
The profiler consists of the usual tycho menu bar with a few buttons, a graphical forest editor, a few counters and a the tycho status bar. We describe each in turn.