[issue9622] Allow to set profile/trace function globally

2010-09-09 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9622 ___ ___ Python-bugs-list

[issue9622] Allow to set profile/trace function globally

2010-08-20 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9622 ___ ___ Python-bugs-list

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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 rep...@bugs.python.org

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com 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 rep...@bugs.python.org

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Sounds like a much simpler change. I'll try that out instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9622 ___

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com 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

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Jon Parise
Jon Parise j...@indelible.org 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

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com 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

[issue9622] Allow to set profile/trace function globally

2010-08-17 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com 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

[issue9622] Allow to set profile/trace function globally

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

[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 krist...@ccpgames.com: 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,