8000 bpo-43760: Rename _PyThreadState_DisableTracing() (GH-29032) · python/cpython@034f607 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark>

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 034f607

Browse files
authored
bpo-43760: Rename _PyThreadState_DisableTracing() (GH-29032)
* Rename _PyThreadState_DisableTracing() to _PyThreadState_PauseTracing() * Rename _PyThreadState_ResetTracing() to _PyThreadState_ResumeTracing()
1 parent 70945d5 commit 034f607

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Include/internal/pycore_pystate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ PyAPI_FUNC(void) _PyThreadState_DeleteExcept(
< 8000 code>134134
PyThreadState *tstate);
135135

136136
static inline void
137-
_PyThreadState_DisableTracing(PyThreadState *tstate)
137+
_PyThreadState_PauseTracing(PyThreadState *tstate)
138138
{
139139
tstate->cframe->use_tracing = 0;
140140
}
141141

142142
static inline void
143-
_PyThreadState_ResetTracing(PyThreadState *tstate)
143+
_PyThreadState_ResumeTracing(PyThreadState *tstate)
144144
{
145145
int use_tracing = (tstate->c_tracefunc != NULL
146146
|| tstate->c_profilefunc != NULL);

Python/ceval.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6165,7 +6165,7 @@ call_trace(Py_tracefunc func, PyObject *obj,
61656165
if (tstate->tracing)
61666166
return 0;
61676167
tstate->tracing++;
6168-
_PyThreadState_DisableTracing(tstate);
6168+
_PyThreadState_PauseTracing(tstate);
61696169
PyFrameObject *f = _PyFrame_GetFrameObject(frame);
61706170
if (f == NULL) {
61716171
return -1;
@@ -6179,7 +6179,7 @@ call_trace(Py_tracefunc func, PyObject *obj,
61796179
}
61806180
result = func(obj, f, what, arg);
61816181
f->f_lineno = 0;
6182-
_PyThreadState_ResetTracing(tstate);
6182+
_PyThreadState_ResumeTracing(tstate);
61836183
tstate->tracing--;
61846184
return result;
61856185
}
@@ -6193,7 +6193,7 @@ _PyEval_CallTracing(PyObject *func, PyObject *args)
61936193
PyObject *result;
61946194

61956195
tstate->tracing = 0;
6196-
_PyThreadState_ResetTracing(tstate);
6196+
_PyThreadState_ResumeTracing(tstate);
61976197
result = PyObject_Call(func, args, NULL);
61986198
tstate->tracing = save_tracing;
61996199
tstate->cframe->use_tracing = save_use_tracing;
@@ -6250,15 +6250,15 @@ _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
62506250
tstate->c_profilefunc = NULL;
62516251
tstate->c_profileobj = NULL;
62526252
/* Must make sure that tracing is not ignored if 'profileobj' is freed */
6253-
_PyThreadState_ResetTracing(tstate);
6253+
_PyThreadState_ResumeTracing(tstate);
62546254
Py_XDECREF(profileobj);
62556255

62566256
Py_XINCREF(arg);
62576257
tstate->c_profileobj = arg;
62586258
tstate->c_profilefunc = func;
62596259

62606260
/* Flag that tracing or profiling is turned on */
6261-
_PyThreadState_ResetTracing(tstate);
6261+
_PyThreadState_ResumeTracing(tstate);
62626262
return 0;
62636263
}
62646264

@@ -6291,15 +6291,15 @@ _PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
62916291
tstate->c_tracefunc = NULL;
62926292
tstate->c_traceobj = NULL;
62936293
/* Must make sure that profiling is not ignored if 'traceobj' is freed */
6294-
_PyThreadState_ResetTracing(tstate);
6294+
_PyThreadState_ResumeTracing(tstate);
62956295
Py_XDECREF(traceobj);
62966296

62976297
Py_XINCREF(arg);
62986298
tstate->c_traceobj = arg;
62996299
tstate->c_tracefunc = func;
63006300

63016301
/* Flag that tracing or profiling is turned on */
6302-
_PyThreadState_ResetTracing(tstate);
6302+
_PyThreadState_ResumeTracing(tstate);
63036303

63046304
return 0;
63056305
}

Python/pystate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,14 +1205,14 @@ void
12051205
PyThreadState_EnterTracing(PyThreadState *tstate)
12061206
{
12071207
tstate->tracing++;
1208-
_PyThreadState_DisableTracing(tstate);
1208+
_PyThreadState_PauseTracing(tstate);
12091209
}
12101210

12111211
void
12121212
PyThreadState_LeaveTracing(PyThreadState *tstate)
12131213
{
12141214
tstate->tracing--;
1215-
_PyThreadState_ResetTracing(tstate);
1215+
_PyThreadState_ResumeTracing(tstate);
12161216
}
12171217

12181218

0 commit comments

Comments
 (0)
0