This changes the thread that checks for new subprocesses, and calls a new ‘should_spy_process’ function to determine if the subprocess should be spied on. It currently checks if the process name if within the whitelist, if no whitelist is provided then it reverts to the old behaviour.
It is important this check happens before checking the symbols, so it will reduce the CPU usage as mentioned in the issue above.
Example usage:
py-spy.exe record -o speedscope.json -f speedscope --pid x --subprocesses --whitelist=python,pythonw,ect
Let me know what your thoughts are, many thanks!
William Rosen
Hello!
The main reasoning behind this change is the following issue: https://github.com/benfred/py-spy/issues/561
This changes the thread that checks for new subprocesses, and calls a new ‘should_spy_process’ function to determine if the subprocess should be spied on. It currently checks if the process name if within the whitelist, if no whitelist is provided then it reverts to the old behaviour.
It is important this check happens before checking the symbols, so it will reduce the CPU usage as mentioned in the issue above. Example usage: py-spy.exe record -o speedscope.json -f speedscope --pid x --subprocesses --whitelist=python,pythonw,ect
Let me know what your thoughts are, many thanks! William Rosen