-
- Notifications
You must be signed in to change notification settings - Fork 33.4k
Open
Labels
Description
Documentation
The doc states at https://docs.python.org/3.15/whatsnew/3.15.html#pep-799-high-frequency-statistical-sampling-profiler:
Profile process 1234 for 10 seconds with default settings:
python -m profiling.sampling 1234
At least on macOS, the argument "1234" is interpreted as a Python script to run, not a PID:
(jgol-peer) 🦐/c/j/peer (main)> sudo -E env PYTHONPATH=src python -m profiling.sampling 1234 Profiler coordinator error: Script not found: /code/jgol/peer/1234 ... ... TypeError: Cannot create or construct a <class 'pstats.SampledStats'> object from <profiling.sampling.pstats_collector.PstatsCollector object at 0x1036441a0>Meanwhile a Python script is accepted:
(jgol-peer) 🦐/c/j/peer (main)> echo "import ops" > foo.py (jgol-peer) 🦐/c/j/peer (main)> sudo -E env PYTHONPATH=src python -m profiling.sampling foo.py Captured 586 samples in 0.06 seconds Sample rate: 10000.02 samples/sec Error rate: 7.17% Profile Stats: ... ...Metadata
Metadata
Assignees
Labels
Projects
Status
Todo