summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-01-28 15:20:33 (GMT)
committerGitHub <noreply@github.com>2022-01-28 15:20:33 (GMT)
commit90ab138bbdc63763ad825ed6d4821367c09c4015 (patch)
tree3adaef410013002de2e488d9c37fb6abc3462082 /Python/specialize.c
parent9a241271139a317597aca71d5971346b2cfe7dbd (diff)
downloadcpython-90ab138bbdc63763ad825ed6d4821367c09c4015.zip
cpython-90ab138bbdc63763ad825ed6d4821367c09c4015.tar.gz
cpython-90ab138bbdc63763ad825ed6d4821367c09c4015.tar.bz2
bpo-46072: Add simple stats for Python calls. (GH-30989)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index a69b73c..aec94d9 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -163,9 +163,18 @@ print_spec_stats(FILE *out, OpcodeStats *stats)
}
#undef PRINT_STAT
+
+static void
+print_call_stats(FILE *out, CallStats *stats)
+{
+ fprintf(out, "Calls to PyEval_EvalDefault: %" PRIu64 "\n", stats->pyeval_calls);
+ fprintf(out, "Calls to Python functions inlined: %" PRIu64 "\n", stats->inlined_py_calls);
+}
+
static void
print_stats(FILE *out, PyStats *stats) {
print_spec_stats(out, stats->opcode_stats);
+ print_call_stats(out, &stats->call_stats);
}
void