problem with hot shot stats

Monu monuindia at gmail.com
Tue Oct 10 13:59:59 EDT 2006


HI All,
I am getting problem in using hotshot profiler.
When I hotshot with lineevents=0, it works fine,
but when I use lineevents=1, I get error in stats

here is my code:

             import hotshot, hotshot.stats
             prof = hotshot.Profile("test.prof",lineevents=1)
             prof.start()
             main()
             prof.stop()
             prof.close()
             stats = hotshot.stats.load("test.prof")
             stats.strip_dirs()
             stats.sort_stats('time', 'calls')
             stats.print_stats(20)

I get following error:
  File "test.py", line 1371, in benchmark
    stats = hotshot.stats.load("test.prof")
  File "/usr/lib64/python2.4/hotshot/stats.py", line 12, in load
    return StatsLoader(filename).load()
  File "/usr/lib64/python2.4/hotshot/stats.py", line 29, in load
    for event in log:
  File "/usr/lib64/python2.4/hotshot/log.py", line 113, in next
    filename, firstlineno, funcname = self._stack[-1]
IndexError: list index out of range

Can anybody help to figure out the problem please?




More information about the Python-list mailing list