In Python there are some libraries to debug code cProfile
where you can follow the execution trace of a program, for example:
import cProfile, pstats, StringIO
pr = cProfile.Profile()
pr.enable()
# Nuestro código
result = [i for i in range(10)]
print(result)
pr.disable()
s = StringIO.StringIO()
sortby = 'cumulative'
ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
ps.print_stats()
print s.getvalue()
It would give us as a result:
2 function calls in 0.000 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.000 0.000 {range}
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
But I would like to know, what libraries or tools exist to follow the execution flow of a complex program where there are hundreds or thousands of executions in a simpler way?