I have essentially done the following:
import cProfile, pstats, StringIO
pr = cProfile.Profile()
pr.enable()
# ... my code did something ...
pr.disable()
s = StringIO.StringIO()
sortby = 'cumulative'
ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
ps.dump_stats('stats.dmp') # dump the stats to a file named stats.dmp
So now i have the file named 'stats.dmp' stored offline.
How can i use pstats to analyze this file for human consumption?
Thanks in advance.
Here's what i found out and the Python program I generated. I tested this with a .dmp file made on linux & analyzed on windows xp. It worked FINE. The Python file is named, "analyze_dmp.py".