diff options
author | Mark Shannon <mark@hotpy.org> | 2022-05-27 15:31:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-27 15:31:41 (GMT) |
commit | bbcf42449e13c0b62f145cd49d12674ef3d5bf64 (patch) | |
tree | 68d3a84f78de47229c46df66eafd4c27474379a7 /Python/ceval.c | |
parent | 8995177030c8b41885ad92b260279b7e622ecaea (diff) | |
download | cpython-bbcf42449e13c0b62f145cd49d12674ef3d5bf64.zip cpython-bbcf42449e13c0b62f145cd49d12674ef3d5bf64.tar.gz cpython-bbcf42449e13c0b62f145cd49d12674ef3d5bf64.tar.bz2 |
GH-90230: Add stats to breakdown the origin of calls to `PyEval_EvalFrame` (GH-93284)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 56b1017..6158524 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1207,6 +1207,7 @@ PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals) if (func == NULL) { return NULL; } + EVAL_CALL_STAT_INC(EVAL_CALL_LEGACY); PyObject *res = _PyEval_Vector(tstate, func, locals, NULL, 0, NULL); Py_DECREF(func); return res; @@ -6432,6 +6433,7 @@ _PyEval_Vector(PyThreadState *tstate, PyFunctionObject *func, if (frame == NULL) { return NULL; } + EVAL_CALL_STAT_INC(EVAL_CALL_VECTOR); PyObject *retval = _PyEval_EvalFrame(tstate, frame, 0); assert( _PyFrame_GetStackPointer(frame) == _PyFrame_Stackbase(frame) || @@ -6507,6 +6509,7 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals, if (func == NULL) { goto fail; } + EVAL_CALL_STAT_INC(EVAL_CALL_LEGACY); res = _PyEval_Vector(tstate, func, locals, allargs, argcount, kwnames); @@ -7299,7 +7302,6 @@ do_call_core(PyThreadState *tstate, ) { PyObject *result; - if (PyCFunction_CheckExact(func) || PyCMethod_CheckExact(func)) { C_TRACE(result, PyObject_Call(func, callargs, kwdict)); return result; @@ -7329,6 +7331,7 @@ do_call_core(PyThreadState *tstate, return result; } } + EVAL_CALL_STAT_INC_IF_FUNCTION(EVAL_CALL_FUNCTION_EX, func); return PyObject_Call(func, callargs, kwdict); } |