summaryrefslogtreecommitdiff
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-05-27 16:31:41 +0100
committerGitHub <noreply@github.com>2022-05-27 16:31:41 +0100
commitbbcf42449e13c0b62f145cd49d12674ef3d5bf64 (patch)
tree68d3a84f78de47229c46df66eafd4c27474379a7 /Objects/genobject.c
parent8995177030c8b41885ad92b260279b7e622ecaea (diff)
downloadcpython-git-bbcf42449e13c0b62f145cd49d12674ef3d5bf64.tar.gz
GH-90230: Add stats to breakdown the origin of calls to `PyEval_EvalFrame` (GH-93284)
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index a88522abf4..2b45e28cbf 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -13,6 +13,7 @@
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "structmember.h" // PyMemberDef
#include "opcode.h" // SEND
+#include "pystats.h"
static PyObject *gen_close(PyGenObject *, PyObject *);
static PyObject *async_gen_asend_new(PyAsyncGenObject *, PyObject *);
@@ -218,6 +219,7 @@ gen_send_ex2(PyGenObject *gen, PyObject *arg, PyObject **presult,
}
gen->gi_frame_state = FRAME_EXECUTING;
+ EVAL_CALL_STAT_INC(EVAL_CALL_GENERATOR);
result = _PyEval_EvalFrame(tstate, frame, exc);
if (gen->gi_frame_state == FRAME_EXECUTING) {
gen->gi_frame_state = FRAME_COMPLETED;