[Stackless] Question abut slprofile.py

Kristján Valur Jónsson kristjan at ccpgames.com
Fri Dec 19 15:52:39 CET 2008


Blue is a module that is part of the eve engine.
It is used in this module solely to provide a timer. Just remove it, and line 22, and then you are all set.

Stackless has, since python 2.3, I think, a special "per tasklet" trace flag.  That is, stackless saves and restores the trace flag in the python trhread state for each tasklet.  This is an attempt, I think, at making profiling (and tracing) sensible, by focusing on a single tasklet only.
It is not very useful for us, however. 
We want to have a running application, and then, just turn on profiling (using slprofile.Profile.start()) and stop it using slprofile.Profile.stop(), ans see what the app has been upto in the meantime.
In order to do this, we had to disable the per-tasklet saving feature of stackless.

I attach the three files that have the relevant modifications, for stackless 2.5

Good luck,
Kristján

-----Original Message-----
From: stackless-bounces at stackless.com [mailto:stackless-bounces at stackless.com] On Behalf Of Kristján Valur Jónsson
Sent: 18. desember 2008 09:11
To: andrewfr_ice at yahoo.com; stackless at stackless.com
Subject: Re: [Stackless] Question abut slprofile.py

Attached.
Note that what we also used is a custom flag in stackless, "globaltrace" which makes the tracing state of python global (for the thread) instead of being maintained for each tasklet.
Not only does it allow us to take a profiling "snapshot" of a running application, it also prevented crashes in stackless, which was crashing horribly if any exceptions were being raised in the trace callbacks.
Actually, the last issue was fixed by us changing slprofile to not rely on the stackless tasklet switching callbacks, which tend to have weird behaviour, but rather just querying for the current tasklet in the trace functions.

If you want, I can provide you with the changed files to the the "globaltrace" functionality, but it is a little more work.
K

-----Original Message-----
From: stackless-bounces at stackless.com [mailto:stackless-bounces at stackless.com] On Behalf Of Andrew Francis
Sent: 17. desember 2008 22:17
To: stackless at stackless.com
Subject: [Stackless] Question abut slprofile.py

Hi Folks:

A while ago, I recall a thread about using a modified profile module, slprofile for use with Stackless. Where can I find slprofile.py and its documentation?

Thanks,
Andrew


      

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stackless_tstate.h
URL: <http://www.stackless.com/pipermail/stackless/attachments/20081219/6e9fa1f9/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: scheduling.c
URL: <http://www.stackless.com/pipermail/stackless/attachments/20081219/6e9fa1f9/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stacklessmodule.c
URL: <http://www.stackless.com/pipermail/stackless/attachments/20081219/6e9fa1f9/attachment-0001.txt>


More information about the Stackless mailing list