summaryrefslogtreecommitdiffstats
path: root/Python/ceval.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/ceval.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/ceval.c')
-rw-r--r--Python/ceval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b69d5aa..70748e8 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2242,6 +2242,7 @@ handle_eval_breaker:
if (new_frame == NULL) {
goto error;
}
+ CALL_STAT_INC(frames_pushed);
_PyFrame_InitializeSpecials(new_frame, getitem,
NULL, code->co_nlocalsplus);
STACK_SHRINK(2);
@@ -4660,6 +4661,7 @@ handle_eval_breaker:
if (new_frame == NULL) {
goto error;
}
+ CALL_STAT_INC(inlined_py_calls);
STACK_SHRINK(argcount);
for (int i = 0; i < argcount; i++) {
new_frame->localsplus[i] = stack_pointer[i];
@@ -4690,6 +4692,7 @@ handle_eval_breaker:
if (new_frame == NULL) {
goto error;
}
+ CALL_STAT_INC(inlined_py_calls);
STACK_SHRINK(argcount);
for (int i = 0; i < argcount; i++) {
new_frame->localsplus[i] = stack_pointer[i];
@@ -4708,7 +4711,6 @@ handle_eval_breaker:
_PyFrame_SetStackPointer(frame, stack_pointer);
new_frame->previous = frame;
frame = cframe.current_frame = new_frame;
- CALL_STAT_INC(inlined_py_calls);
goto start_frame;
}
@@ -6078,6 +6080,7 @@ _PyEvalFramePushAndInit(PyThreadState *tstate, PyFunctionObject *func,
{
PyCodeObject * code = (PyCodeObject *)func->func_code;
size_t size = code->co_nlocalsplus + code->co_stacksize + FRAME_SPECIALS_SIZE;
+ CALL_STAT_INC(frames_pushed);
InterpreterFrame *frame = _PyThreadState_BumpFramePointer(tstate, size);
if (frame == NULL) {
goto fail;