Look at the result of this script:
-----------
package require profiler
profiler::init
proc profile_a {} {
for {set f 0} {$f<100} {incr f} {
profile_b
}
}
proc profile_b {} {
for {set f 0} {$f<100000} {incr f} {}
}
profile_a
profiler::reset
profile_a
puts [profiler::print]
-----------
for profile_a, it prints:
Total runtime: 729842
Total descendant time: 1441896
i.e. Total descendant time>Total runtime
The problem is that ::profiler::descendants isn't modified in ::profiler::reset.