mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
improve tracing performance when f_trace is NULL (closes #16672)
Patch by Xavier de Gaye.
This commit is contained in:
parent
6a7a49c631
commit
6f0c94df50
2 changed files with 6 additions and 3 deletions
|
@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #16672: Improve performance tracing performance
|
||||||
|
|
||||||
- Issue #14470: Remove w9xpopen support per PEP 11.
|
- Issue #14470: Remove w9xpopen support per PEP 11.
|
||||||
|
|
||||||
- Issue #9856: Replace deprecation warning with raising TypeError
|
- Issue #9856: Replace deprecation warning with raising TypeError
|
||||||
|
|
|
@ -1277,7 +1277,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
||||||
/* line-by-line tracing support */
|
/* line-by-line tracing support */
|
||||||
|
|
||||||
if (_Py_TracingPossible &&
|
if (_Py_TracingPossible &&
|
||||||
tstate->c_tracefunc != NULL && !tstate->tracing) {
|
tstate->c_tracefunc != NULL && !tstate->tracing &&
|
||||||
|
f->f_trace != NULL) {
|
||||||
int err;
|
int err;
|
||||||
/* see maybe_call_line_trace
|
/* see maybe_call_line_trace
|
||||||
for expository comments */
|
for expository comments */
|
||||||
|
@ -3008,7 +3009,7 @@ error:
|
||||||
/* Log traceback info. */
|
/* Log traceback info. */
|
||||||
PyTraceBack_Here(f);
|
PyTraceBack_Here(f);
|
||||||
|
|
||||||
if (tstate->c_tracefunc != NULL)
|
if (tstate->c_tracefunc != NULL && f->f_trace != NULL)
|
||||||
call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, f);
|
call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, f);
|
||||||
|
|
||||||
fast_block_end:
|
fast_block_end:
|
||||||
|
@ -3127,7 +3128,7 @@ fast_yield:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tstate->use_tracing) {
|
if (tstate->use_tracing) {
|
||||||
if (tstate->c_tracefunc) {
|
if (tstate->c_tracefunc && f->f_trace != NULL) {
|
||||||
if (why == WHY_RETURN || why == WHY_YIELD) {
|
if (why == WHY_RETURN || why == WHY_YIELD) {
|
||||||
if (call_trace(tstate->c_tracefunc,
|
if (call_trace(tstate->c_tracefunc,
|
||||||
tstate->c_traceobj, f,
|
tstate->c_traceobj, f,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue