[issue9622] Allow to set profile/trace function globally

2010-09-09 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue9622] Allow to set profile/trace function globally

2010-08-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Setting this to invalid, since there already are APIs to do this, at least from .py code. -- resolution: -> invalid ___ Python tracker ___

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I just realized that this is probably a redundant change. We have C apis to get all the Thread states in an interpreter state (I didn't even know there was such a thing as multiple interpreter states, but there!) This is the PyInterpreterState_ThreadHea

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Indeed it is. This is a remnant of the previous method. I will fix it, and add documentation. I also think I'll leave the change to _lsprof out of this so that this change can stand on its own, irrespective of the profiling engine being used.

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Jon Parise
Jon Parise added the comment: There are a few places in the patch where you call the global version immediately followed by the local version. For example: +PyEval_SetGlobalTrace(NULL, NULL); PyEval_SetTrace(NULL, NULL); Isn't the local call now redundant given that the glob

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Here is a new, much simpler patch, which simply sets the flags on all the threads (accessable as a linked list of PyThreadState objects) as suggested by Antoine. (Note that neither of the patches has the necessary enhancements to _lsprof.c to make th

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Sounds like a much simpler change. I'll try that out instead. -- ___ Python tracker ___ ___

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Good question. Is that simple to do? I didn't think to look if there > were a central list of all python TLS states. There's a linked list from the current interpreter state, which in turn can be got from the current thread state (see Include/pystate.h). Of

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Good question. Is that simple to do? I didn't think to look if there were a central list of all python TLS states. -- ___ Python tracker

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Adding new "global" objects looks a bit complicated. Why not simply update all thread-local objects when the "global" flag is set? -- nosy: +pitrou ___ Python tracker

[issue9622] Allow to set profile/trace function globally

2010-08-16 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson : issue 9609 updates _lsprof.c to be multi-stack aware. This allows cProfile.Profile() objects to be shared by many threads and provide meaningfull results. This update makes it more convenient to profile running, multi-threaded, applications. By a