--- Python-3.12.2/Python/ceval_macros.h.~1~ Tue Feb 6 12:19:44 2024 +++ Python-3.12.2/Python/ceval_macros.h Thu Feb 8 22:23:45 2024 @@ -281,6 +281,11 @@ #define BUILTINS() frame->f_builtins #define LOCALS() frame->f_locals +#define DTRACE_FUNCTION_EXIT() \ + if (PyDTrace_FUNCTION_RETURN_ENABLED()) { \ + dtrace_function_return(frame); \ + } + #define DTRACE_FUNCTION_ENTRY() \ if (PyDTrace_FUNCTION_ENTRY_ENABLED()) { \ dtrace_function_entry(frame); \ --- Python-3.12.2/Python/ceval_macros.h.~2~ Fri Feb 9 11:40:42 2024 +++ Python-3.12.2/Python/ceval_macros.h Fri Feb 9 12:03:40 2024 @@ -83,6 +83,9 @@ #ifdef LLTRACE #define PRE_DISPATCH_GOTO() if (lltrace) { \ lltrace_instruction(frame, stack_pointer, next_instr); } +#elif defined(WITH_DTRACE) +#define PRE_DISPATCH_GOTO() if (PyDTrace_LINE_ENABLED()) { \ + maybe_dtrace_line(frame, next_instr); } #else #define PRE_DISPATCH_GOTO() ((void)0) #endif