I'm using hotshot to profile my Python program, Is there any way to aggregated the profiles and see a total result in Kcachegrind?
After some research I used pstats to aggregate the profiles in the way given below and used pyprof2calltree
to convert the result into kcachegrind format
>>> pf = pstats.Stats("profile1.prof")
>>> p2 = pf.add("profile2.prof")
>>> p2.dump_stats("aggregated.prof")
pyprof2calltree
gave me an error like this.
File "/usr/local/bin/pyprof2calltree", line 9, in <module>
load_entry_point('pyprof2calltree==1.1.0', 'console_scripts', 'pyprof2calltree')()
File "/usr/local/lib/python2.7/dist-packages/pyprof2calltree.py", line 240, in main
kg.output(file(outfile, 'wb'))
File "/usr/local/lib/python2.7/dist-packages/pyprof2calltree.py", line 106, in output
self._entry(entry)
File "/usr/local/lib/python2.7/dist-packages/pyprof2calltree.py", line 167, in _entry
self._subentry(lineno, subentry, call_info)
File "/usr/local/lib/python2.7/dist-packages/pyprof2calltree.py", line 178, in _subentry
print >> out_file, 'calls=%d %d' % (call_info[0], co_firstlineno)
TypeError: 'int' object is not subscriptable
Am I doing something wrong here or is there any other way to do this?