GH-129763: Remove the LLTRACE macro (GH-129764)

This commit is contained in:
Brandt Bucher 2025-02-07 08:49:51 -08:00 committed by GitHub
parent f52a3a51eb
commit fbaa6c8ff0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 25 additions and 49 deletions

View file

@ -5301,7 +5301,7 @@ dummy_func(
goto exception_unwind;
}
/* Resume normal execution */
#ifdef LLTRACE
#ifdef Py_DEBUG
if (frame->lltrace >= 5) {
lltrace_resume_frame(frame);
}
@ -5340,15 +5340,7 @@ dummy_func(
}
next_instr = frame->instr_ptr;
#ifdef LLTRACE
{
int lltrace = maybe_lltrace_resume_frame(frame, GLOBALS());
frame->lltrace = lltrace;
if (lltrace < 0) {
goto exit_unwind;
}
}
#endif
LLTRACE_RESUME_FRAME();
#ifdef Py_DEBUG
/* _PyEval_EvalFrameDefault() must not be called with an exception set,

View file

@ -43,11 +43,6 @@
#include <stdbool.h> // bool
#ifdef Py_DEBUG
/* For debugging the interpreter: */
# define LLTRACE 1 /* Low-level trace feature */
#endif
#if !defined(Py_BUILD_CORE)
# error "ceval.c must be build with Py_BUILD_CORE define for best performance"
#endif
@ -136,7 +131,7 @@
#endif
#ifdef LLTRACE
#ifdef Py_DEBUG
static void
dump_stack(_PyInterpreterFrame *frame, _PyStackRef *stack_pointer)
{
@ -818,7 +813,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
entry_frame.owner = FRAME_OWNED_BY_INTERPRETER;
entry_frame.visited = 0;
entry_frame.return_offset = 0;
#ifdef LLTRACE
#ifdef Py_DEBUG
entry_frame.lltrace = 0;
#endif
/* Push frame */

View file

@ -108,21 +108,21 @@
#endif
/* PRE_DISPATCH_GOTO() does lltrace if enabled. Normally a no-op */
#ifdef LLTRACE
#ifdef Py_DEBUG
#define PRE_DISPATCH_GOTO() if (frame->lltrace >= 5) { \
lltrace_instruction(frame, stack_pointer, next_instr, opcode, oparg); }
#else
#define PRE_DISPATCH_GOTO() ((void)0)
#endif
#if LLTRACE
#ifdef Py_DEBUG
#define LLTRACE_RESUME_FRAME() \
do { \
int lltrace = maybe_lltrace_resume_frame(frame, GLOBALS()); \
frame->lltrace = lltrace; \
if (lltrace < 0) { \
JUMP_TO_LABEL(exit_unwind); \
} \
frame->lltrace = lltrace; \
} while (0)
#else
#define LLTRACE_RESUME_FRAME() ((void)0)

View file

@ -11416,7 +11416,7 @@ JUMP_TO_LABEL(error);
JUMP_TO_LABEL(exception_unwind);
}
/* Resume normal execution */
#ifdef LLTRACE
#ifdef Py_DEBUG
if (frame->lltrace >= 5) {
lltrace_resume_frame(frame);
}
@ -11458,16 +11458,7 @@ JUMP_TO_LABEL(error);
JUMP_TO_LABEL(exit_unwind);
}
next_instr = frame->instr_ptr;
#ifdef LLTRACE
{
int lltrace = maybe_lltrace_resume_frame(frame, GLOBALS());
frame->lltrace = lltrace;
if (lltrace < 0) {
JUMP_TO_LABEL(exit_unwind);
}
}
#endif
LLTRACE_RESUME_FRAME();
#ifdef Py_DEBUG
/* _PyEval_EvalFrameDefault() must not be called with an exception set,
because it can clear it (directly or indirectly) and so the