diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2023-11-03 16:39:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-03 16:39:50 (GMT) |
commit | e0afed7e276b6611a2142ec70a0440298d528305 (patch) | |
tree | 9170a4828e2961750e84251115ee5ac91f31f31e /Include/internal | |
parent | 2bc01cc0c72a3d91bdcce09886efa987a90396d9 (diff) | |
download | cpython-e0afed7e276b6611a2142ec70a0440298d528305.zip cpython-e0afed7e276b6611a2142ec70a0440298d528305.tar.gz cpython-e0afed7e276b6611a2142ec70a0440298d528305.tar.bz2 |
gh-103615: Use local events for opcode tracing (GH-109472)
* Use local monitoring for opcode trace
* Remove f_opcode_trace_set
* Add test for setting f_trace_opcodes after settrace
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_ceval.h | 2 | ||||
-rw-r--r-- | Include/internal/pycore_instruments.h | 2 | ||||
-rw-r--r-- | Include/internal/pycore_interp.h | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index 339ced3..c372b72 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -22,6 +22,8 @@ PyAPI_FUNC(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyO extern int _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg); +extern int _PyEval_SetOpcodeTrace(PyFrameObject *f, bool enable); + // Helper to look up a builtin object // Export for 'array' shared extension PyAPI_FUNC(PyObject*) _PyEval_GetBuiltin(PyObject *); diff --git a/Include/internal/pycore_instruments.h b/Include/internal/pycore_instruments.h index 97dcfb9..eae8371 100644 --- a/Include/internal/pycore_instruments.h +++ b/Include/internal/pycore_instruments.h @@ -63,6 +63,8 @@ typedef uint32_t _PyMonitoringEventSet; PyObject *_PyMonitoring_RegisterCallback(int tool_id, int event_id, PyObject *obj); int _PyMonitoring_SetEvents(int tool_id, _PyMonitoringEventSet events); +int _PyMonitoring_SetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEventSet events); +int _PyMonitoring_GetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEventSet *events); extern int _Py_call_instrumentation(PyThreadState *tstate, int event, diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 78b841a..498db8b 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -200,7 +200,6 @@ struct _is { uint32_t next_func_version; _Py_GlobalMonitors monitors; - bool f_opcode_trace_set; bool sys_profile_initialized; bool sys_trace_initialized; Py_ssize_t sys_profiling_threads; /* Count of threads with c_profilefunc set */ |