aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/instrumentation.c
diff options
context:
space:
mode:
authorTian Gao <gaogaotiantian@hotmail.com>2024-02-29 22:46:33 -0800
committerGitHub <noreply@github.com>2024-03-01 07:46:33 +0100
commit7895a61168aad4565a1d953104c9ec620e7c588f (patch)
tree8234320f8978961688f8abc4baf1f6ad7faf5c2d /Python/instrumentation.c
parent339c8e1c13adc299a0e2e49c93067e7817692380 (diff)
downloadcpython-7895a61168aad4565a1d953104c9ec620e7c588f.tar.gz
cpython-7895a61168aad4565a1d953104c9ec620e7c588f.zip
gh-116098: Revert "gh-107674: Improve performance of `sys.settrace` (GH-114986)" (GH-116178)
Revert "gh-107674: Improve performance of `sys.settrace` (GH-114986)" This reverts commit 0a61e237009bf6b833e13ac635299ee063377699.
Diffstat (limited to 'Python/instrumentation.c')
-rw-r--r--Python/instrumentation.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/instrumentation.c b/Python/instrumentation.c
index 4b7d8b5a587..6f1bc2e0a10 100644
--- a/Python/instrumentation.c
+++ b/Python/instrumentation.c
@@ -1156,13 +1156,15 @@ int
_Py_call_instrumentation_line(PyThreadState *tstate, _PyInterpreterFrame* frame, _Py_CODEUNIT *instr, _Py_CODEUNIT *prev)
{
PyCodeObject *code = _PyFrame_GetCode(frame);
- assert(tstate->tracing == 0);
assert(is_version_up_to_date(code, tstate->interp));
assert(instrumentation_cross_checks(tstate->interp, code));
int i = (int)(instr - _PyCode_CODE(code));
_PyCoMonitoringData *monitoring = code->_co_monitoring;
_PyCoLineInstrumentationData *line_data = &monitoring->lines[i];
+ if (tstate->tracing) {
+ goto done;
+ }
PyInterpreterState *interp = tstate->interp;
int8_t line_delta = line_data->line_delta;
int line = compute_line(code, i, line_delta);