diff options
author | Michael Droettboom <mdboom@gmail.com> | 2024-01-25 11:10:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 11:10:51 (GMT) |
commit | ea3cd0498c443e93be441736c804258e93d21edd (patch) | |
tree | ab975dc0fe8c933fd2c197275a7d9fc6598aa04b /Python/specialize.c | |
parent | c63c6142f9146e1e977f4c824c56e8979e6aca87 (diff) | |
download | cpython-ea3cd0498c443e93be441736c804258e93d21edd.zip cpython-ea3cd0498c443e93be441736c804258e93d21edd.tar.gz cpython-ea3cd0498c443e93be441736c804258e93d21edd.tar.bz2 |
gh-114312: Collect stats for unlikely events (GH-114493)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r-- | Python/specialize.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c index 13e0440..a9efbe0 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -268,6 +268,16 @@ print_optimization_stats(FILE *out, OptimizationStats *stats) } static void +print_rare_event_stats(FILE *out, RareEventStats *stats) +{ + fprintf(out, "Rare event (set_class): %" PRIu64 "\n", stats->set_class); + fprintf(out, "Rare event (set_bases): %" PRIu64 "\n", stats->set_bases); + fprintf(out, "Rare event (set_eval_frame_func): %" PRIu64 "\n", stats->set_eval_frame_func); + fprintf(out, "Rare event (builtin_dict): %" PRIu64 "\n", stats->builtin_dict); + fprintf(out, "Rare event (func_modification): %" PRIu64 "\n", stats->func_modification); +} + +static void print_stats(FILE *out, PyStats *stats) { print_spec_stats(out, stats->opcode_stats); @@ -275,6 +285,7 @@ print_stats(FILE *out, PyStats *stats) print_object_stats(out, &stats->object_stats); print_gc_stats(out, stats->gc_stats); print_optimization_stats(out, &stats->optimization_stats); + print_rare_event_stats(out, &stats->rare_event_stats); } void |