[Stackless] stackless profiling?

Jeff Senn senn at maya.com
Wed Aug 28 19:08:20 CEST 2002


Jeff Senn <senn at maya.com> writes:
> I just tried using the profiler with stackless with ...um... mixed
> success.
...

Um... on looking closer at profile.py, it's going to need quite an
overhaul to work with stackless -- in particular I think it will need
to keep separate prior frame state around for each tasklet.  I'm not
up to doing this at the moment...

But I think the lock should be there for when someone gets around to
doing it...  I guess tracing is similar. Maybe something like:

Index: ceval.c
===================================================================
RCS file: /home/cvs/stackless/src/Python/ceval.c,v
retrieving revision 1.17
diff -u -r1.17 ceval.c
--- ceval.c     2002/07/21 00:23:37     1.17
+++ ceval.c     2002/08/28 17:06:02
@@ -612,6 +612,11 @@
        assert(stack_pointer != NULL);
        f->f_stacktop = NULL;   /* remains NULL unless yield suspends frame */

+#ifdef STACKLESS
+        {
+         int oldatomic = tstate->st.current->flags.atomic;
+         tstate->st.current->flags.atomic = 1;
+#endif
        if (tstate->use_tracing) {
                if (tstate->c_tracefunc != NULL) {
                        /* tstate->c_tracefunc, if defined, is a
@@ -644,6 +649,10 @@
                        }
                }
        }
+#ifdef STACKLESS
+         tstate->st.current->flags.atomic = oldatomic;
+       }
+#endif

 #ifdef LLTRACE
        lltrace = PyDict_GetItemString(f->f_globals,"__lltrace__") != NULL;



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



More information about the Stackless mailing list