mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython (GH-103083)
* The majority of the monitoring code is in instrumentation.c * The new instrumentation bytecodes are in bytecodes.c * legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
This commit is contained in:
parent
dce2d38cb0
commit
411b169281
44 changed files with 6029 additions and 1625 deletions
|
@ -19,6 +19,7 @@ struct _frame {
|
|||
struct _PyInterpreterFrame *f_frame; /* points to the frame data */
|
||||
PyObject *f_trace; /* Trace function */
|
||||
int f_lineno; /* Current line number. Only valid if non-zero */
|
||||
int f_last_traced_line; /* The last line traced for this frame */
|
||||
char f_trace_lines; /* Emit per-line trace events? */
|
||||
char f_trace_opcodes; /* Emit per-opcode trace events? */
|
||||
char f_fast_as_locals; /* Have the fast locals of this frame been converted to a dict? */
|
||||
|
@ -137,10 +138,16 @@ _PyFrame_GetLocalsArray(_PyInterpreterFrame *frame)
|
|||
return frame->localsplus;
|
||||
}
|
||||
|
||||
/* Fetches the stack pointer, and sets stacktop to -1.
|
||||
Having stacktop <= 0 ensures that invalid
|
||||
values are not visible to the cycle GC.
|
||||
We choose -1 rather than 0 to assist debugging. */
|
||||
static inline PyObject**
|
||||
_PyFrame_GetStackPointer(_PyInterpreterFrame *frame)
|
||||
{
|
||||
return frame->localsplus+frame->stacktop;
|
||||
PyObject **sp = frame->localsplus + frame->stacktop;
|
||||
frame->stacktop = -1;
|
||||
return sp;
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue