[issue29502] Should PyObject_Call() call the profiler on C functions, use C_TRACE() macro?

STINNER Victor report at bugs.python.org
Thu Feb 9 06:05:29 EST 2017


STINNER Victor added the comment:

Output of attached profiler_c_code.py example:
---
haypo at selma$ ./python profiler_c_code.py 
(<frame object at 0xf9d788>, 'call', None)
(<frame object at 0xf9d788>, 'return', 'h')
(<frame object at 0xf9d788>, 'call', None)
(<frame object at 0xf9d788>, 'return', 'e')
(<frame object at 0xf9d788>, 'call', None)
(<frame object at 0xf9d788>, 'return', 'l')
(<frame object at 0xf9d788>, 'call', None)
(<frame object at 0xf9d788>, 'return', 'l')
(<frame object at 0xf9d788>, 'call', None)
(<frame object at 0xf9d788>, 'return', 'o')
(<frame object at 0xf9d498>, 'c_call', <built-in function setprofile>)
---

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?

----------
Added file: http://bugs.python.org/file46604/profiler_c_code.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29502>
_______________________________________


More information about the Python-bugs-list mailing list