[Stackless] Profiler

Tom Locke tom at livelogix.com
Fri Mar 12 05:18:31 CET 2004

[...standard profiler doesn't work...]
> Are you sure about that? Last time I checked it worked fine!
I'm getting an assertion error:
Python 2.3.3 Stackless 3.0 040302 (#51, Mar  3 2004, 14:46:54) [MSC
v.1200 32 bi
t (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import stackless
>>> import profile
>>> def foo(): print 10
>>> profile.run('stackless.tasklet(foo)(); stackless.schedule()')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "c:\python23\lib\profile.py", line 71, in run
    prof = prof.run(statement)
  File "c:\python23\lib\profile.py", line 403, in run
    return self.runctx(cmd, dict, dict)
  File "c:\python23\lib\profile.py", line 409, in runctx
    exec cmd in globals, locals
  File "<string>", line 1, in ?
  File "<stdin>", line 1, in foo
  File "c:\python23\lib\profile.py", line 214, in trace_dispatch_i
    if self.dispatch[event](self, frame,t):
  File "c:\python23\lib\profile.py", line 260, in trace_dispatch_call
    assert rframe.f_back is frame.f_back, ("Bad call", rfn,
AssertionError: ('Bad call', ('<string>', 1, '?'), <stackless.frame
object at 0x008BCA08>, <stackless.frame object at 0x0093BB90>,
<stackless.frame object at 0x0094CA48>, <stackless.baseframe object at
The code around the assertion, looks like:
def trace_dispatch_call(self, frame, t):
    if self.cur and frame.f_back is not self.cur[-2]:
        rpt, rit, ret, rfn, rframe, rcur = self.cur
        if not isinstance(rframe, Profile.fake_frame):
            assert rframe.f_back is frame.f_back, ("Bad call", rfn,
                                                   frame, frame.f_back)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20040312/0a273ac3/attachment.htm>
-------------- next part --------------
Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list