summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-02-02 11:01:33 (GMT)
committerGitHub <noreply@github.com>2022-02-02 11:01:33 (GMT)
commit187930f74c44e460ba09c60ba5d9bb4fac543d8f (patch)
tree34c1c536986e6a5b33b66e4aad10e7594ccb3ba0 /Python/pystate.c
parenta05866ce3e617e2b74c205f27a89eab63c7b3101 (diff)
downloadcpython-187930f74c44e460ba09c60ba5d9bb4fac543d8f.zip
cpython-187930f74c44e460ba09c60ba5d9bb4fac543d8f.tar.gz
cpython-187930f74c44e460ba09c60ba5d9bb4fac543d8f.tar.bz2
bpo-46072: Add some frame stats. (GH-31060)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 4378d78..7746794 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -3,6 +3,7 @@
#include "Python.h"
#include "pycore_ceval.h"
+#include "pycore_code.h" // stats
#include "pycore_frame.h"
#include "pycore_initconfig.h"
#include "pycore_object.h" // _PyType_InitCache()
@@ -2219,6 +2220,7 @@ _PyThreadState_PushFrame(PyThreadState *tstate, PyFunctionObject *func, PyObject
int nlocalsplus = code->co_nlocalsplus;
size_t size = nlocalsplus + code->co_stacksize +
FRAME_SPECIALS_SIZE;
+ CALL_STAT_INC(frames_pushed);
InterpreterFrame *frame = _PyThreadState_BumpFramePointer(tstate, size);
if (frame == NULL) {
return NULL;