mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
The function__entry and function__return probes stopped working in Python 3.11 when the interpreter was restructured around the new bytecode system. This change restores these probes by adding DTRACE_FUNCTION_ENTRY() at the start_frame label in bytecodes.c and DTRACE_FUNCTION_RETURN() in the RETURN_VALUE and YIELD_VALUE instructions. The helper functions are defined in ceval.c and extract the filename, function name, and line number from the frame before firing the probe. This builds on the approach from https://github.com/python/cpython/pull/125019 but avoids modifying the JIT template since the JIT does not currently support DTrace. The macros are conditionally compiled with WITH_DTRACE and are no-ops otherwise. The tests have been updated to use modern opcode names (CALL, CALL_KW, CALL_FUNCTION_EX) and a new bpftrace backend was added for Linux CI alongside the existing SystemTap tests. Line probe tests were removed since that probe was never restored after 3.11.
15 lines
660 B
Text
15 lines
660 B
Text
function__entry:call_stack.py:function_1:1
|
|
function__entry:call_stack.py:function_3:9
|
|
function__return:call_stack.py:function_3:10
|
|
function__return:call_stack.py:function_1:2
|
|
function__entry:call_stack.py:function_2:5
|
|
function__entry:call_stack.py:function_1:1
|
|
function__return:call_stack.py:function_3:10
|
|
function__return:call_stack.py:function_1:2
|
|
function__return:call_stack.py:function_2:6
|
|
function__entry:call_stack.py:function_3:9
|
|
function__return:call_stack.py:function_3:10
|
|
function__entry:call_stack.py:function_4:13
|
|
function__return:call_stack.py:function_4:14
|
|
function__entry:call_stack.py:function_5:18
|
|
function__return:call_stack.py:function_5:21
|