DBUG by Fred Fish (a macro based C debugging package)
- DBUG is an example of an internal debugger, because it
requires internal instrumentation of a program
- Monty has made it thread-safe and uses it to debug MySQL.
It looks like a good way to debug kernel-based LinuxThreads
for which gdb is of no help.
- Quick summary of the capabilities:
- Execution trace showing function level control flow
in a semi-graphical manner using indentation to
indicate nesting depth.
- Output the values of all, or any subset of, key internal
variables.
- Limit actions to a specific set of named functions.
- Limit function trace to a specified nesting depth.
- Label each output line with source file name and line number.
- Label each output line with name of current process.
- Push or pop internal debugging state to allow execution
with built in debugging defaults.
- Redirect the debug output stream to standard output (stdout)
or a named file.
- Performance profiling.
- With performance profiling turned on DBUG produces a trace file
which can be fed into an analysis program.
It produces a summary listing which includes:
- the name of each traced function,
- the number of times it was called,
- the percentage of total calls,
- the time spent executing the function,
- the proportion of the total time and
- the 'importance'.
The last is a metric which is obtained by multiplying the proportions
of calls and the proportions of time for each function. The
greater the importance, the more likely it is that a speedup
could be obtained by reducing the time taken by that function.
- To use it, you'll need to get
MySQL and extract it. Maybe someone
could make a standalone distribution :^)
- DBUG licensing, credits and history:
- Fred Fish released the DBUG package 1987 to the public domain. Very
nice of him :)
- Binayak Banerjee made a profiler available for this 1989, also in the
public domain.
- Monty did many speed improvements, made it more portable (works even
in MSDOS), added a few new options, added the _db_dump function and
made it thread safe. All his changes are also in the public domain.
|