diff options
author | Mark Shannon <mark@hotpy.org> | 2022-02-10 15:55:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 15:55:52 (GMT) |
commit | 1a6411f5738895fa48d35a93435f7c7b6c17bdb9 (patch) | |
tree | 7a845e0e2d395ee07079cc604081c1dd5d72a7e0 /Python/ceval.c | |
parent | e19059ecd80d39dca378cd19f72c5008b1957976 (diff) | |
download | cpython-1a6411f5738895fa48d35a93435f7c7b6c17bdb9.zip cpython-1a6411f5738895fa48d35a93435f7c7b6c17bdb9.tar.gz cpython-1a6411f5738895fa48d35a93435f7c7b6c17bdb9.tar.bz2 |
Gather stats for PRECALL_METHOD. (GH-31259)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index c3703a7..ffce6b7 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4451,8 +4451,11 @@ handle_eval_breaker: assert(call_shape.kwnames == NULL); #ifdef Py_STATS extern int _PySpecialization_ClassifyCallable(PyObject *); - _py_stats.opcode_stats[PRECALL_FUNCTION].specialization.failure++; - _py_stats.opcode_stats[PRECALL_FUNCTION].specialization.failure_kinds[_PySpecialization_ClassifyCallable(call_shape.callable)]++; + SpecializationStats *stats = + &_py_stats.opcode_stats[PRECALL_FUNCTION].specialization; + stats->failure++; + int kind = _PySpecialization_ClassifyCallable(call_shape.callable); + stats->failure_kinds[kind]++; #endif DISPATCH(); } @@ -4493,6 +4496,14 @@ handle_eval_breaker: call_shape.total_args = nargs; assert(call_shape.kwnames == NULL); +#ifdef Py_STATS + extern int _PySpecialization_ClassifyCallable(PyObject *); + SpecializationStats *stats = + &_py_stats.opcode_stats[PRECALL_METHOD].specialization; + stats->failure++; + int kind = _PySpecialization_ClassifyCallable(call_shape.callable); + stats->failure_kinds[kind]++; +#endif DISPATCH(); } |