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
Should PyObject_Call() call the profiler on C functions, use C_TRACE() macro? #73688
Comments
call_function() and do_call_core() functions of Python/ceval.c use C_TRACE() macro to call the profiler, but PyObject_Call() and similar functions like _PyObject_FastCallKeywords() don't. Is it a bug or a deliberate choice for performance? Since PyObject_Call() and similar functions have now fast paths, I don't think that it's still needed to have these fast paths in ceval.c too. But I kept fast paths in ceval.c because of C_TRACE(). |
Output of attached profiler_c_code.py example: Except of sys.setprofile(), the profiler doesn't see any C calls! list() and map() are simply "hidden". So tools like coverage miss a lot of C call? Again, is it a compromise between performance and correctness, or just a regular bug? |
I always assumed that enabling profiling only from the Python bytecode interpreter was a deliberate choice. |
bpo-30990 is related |
FYI, _lsprof uses PyObject_Call() Lines 120 to 123 in ea68d83
If PyObject_Call() trigger profiler, lsprof should avoid recursion. |
This issue has no activity for 3 years and was created 4 years ago. I close it. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: