bpo-46072: Add simple stats for Python calls. (GH-30989)

This commit is contained in:
Mark Shannon 2022-01-28 15:20:33 +00:00 committed by GitHub
parent 9a24127113
commit 90ab138bbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View file

@ -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