-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3.12 perf import #4918
Comments
As an alternative to using Here's an example: https://share.firefox.dev/4c5iJDy |
We forgot to answer the initial question: yes we're interested! It should be possible to detect a python-origin linux-perf profile and do some pre-filtering or even completely move the parsing to a different function. |
@jrmuizel nice! Although it may need some more work. Your branch said "rote ... Samples: 1452", the file had 20kB. But the profile? https://share.firefox.dev/49KblMm Py-spy may be cute but perf is the unrivaled (on linux). I will look into bin directory. I may send a PR (in a few weeks). BTW: Are there any plans to make the profiler UI more generic (less Firefox specific)? |
Python 3.12 has support for linux perf. Firefox profiler is the best ui. Using them together with the recommended
perf script -F +pid > test.perf
works but it could be better. Python is wildly used. Would you be interested in improvements for it in profiler codebase?The generated stack trace (by perf script) looks like:
The improvements from here can be:
_PyEval_EvalFrameDefault.cold
andPyObject_Vectorcall
. Similar (and even bigger) noise is around generators and async. All cPython interpreter frames.py::Process.username:/tmp/test/top/psutil/__init__.py+0x6 (/tmp/perf-1810767.map)
as function namepy::Process.username:/tmp/test/top/psutil/__init__.py
at file/tmp/perf-1810767.map
. Obviously that could be better.cfunction_vectorcall
on stack trace before anypy::*
may indicate that. But it may not be trivial.I have quickly tried
perf script -F +pid | ./python_perf_cleaner.py > test.perf
. Where mypython_perf_cleaner.py
is:This is a big improvement for me. It does solve the first two issues!
For the third issue - identifying native frames... Looking at linux-perf.js I don't see an easy way to rewrite the stack traces even if one would figure out how to recognize them.
The question is if anybody (but me) cares about this? How to do it if so? Hacking directly the perf import in this codebase? Or maybe throwing the improved python reprocessing script to github. But the script would have to start writing your Profile.
BTW: Similar (but much easier) is Java. It is also big ecosystem. Might be worth extra few lines to make it nicer.
BTW: Is there (both ways) convertor of your Profile to Google's pprof (profile.proto)[https://github.com/google/pprof/blob/main/proto/profile.proto]?
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: