Uh oh!
There was an error while loading. Please reload this page.
gh-109329: Count tier2 miss opcodes - #110561
Conversation
22212fb to
a08a127Comparemarkshannon
commented
Oct 30, 2023
Looks like a useful feature. Do you have example output for this? |
gvanrossum
left a comment
There was a problem hiding this comment.
Mark put in a question, I can merge once you've answered that.
| #define GC_STAT_ADD(gen, name, n) do { if (_Py_stats) _Py_stats->gc_stats[(gen)].name += (n); } while (0) | ||
| #define OPT_STAT_INC(name) do { if (_Py_stats) _Py_stats->optimization_stats.name++; } while (0) | ||
| #define UOP_EXE_INC(opname) do { if (_Py_stats) _Py_stats->optimization_stats.opcode[opname].execution_count++; } while (0) | ||
| #define UOP_STAT_INC(opname, name) do { if (_Py_stats) { assert(opname < 512); _Py_stats->optimization_stats.opcode[opname].name++; } } while (0) |
There was a problem hiding this comment.
I would have named this arg opcode (or OPCODE, per recent Discourse thread), since to me opname is a variable of type char * giving the opcode's name; opcode is the (named) constant representing the opcode, which it is. (I did a small double take when I saw assert(opname < 512). :-) But it's too late, and opname is used in several places above as well, so let's keep it this way.
Here's an example from the raytrace benchmark:
|
This keeps a separate 'miss' counter for each micro-opcode, incremented whenever a guard uop takes a deoptimization side exit.
This keeps a separate 'miss' counter for each micro-opcode, incremented whenever a guard uop takes a deoptimization side exit.
This keeps a separate 'miss' counter for each micro-opcode, incremented whenever a guard uop takes a deoptimization side exit.
This records the number of times a specific uop causes a DEOPT (in the same way this is already done for Tier 1). The
summarize_stats.pyscript already supports the display, by virtue of reusing the code from Tier 1.Marked as draft because it is necessarily built on #110398 which should be merged first.