aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-02-14 15:53:38 +0000
committerGitHub <noreply@github.com>2022-02-14 15:53:38 +0000
commit0ade875ebe0d83709ec338616d6abe439c81f29b (patch)
tree107c30ef04296fcaaa06424e33eaaec62358a4d9 /Python
parent15ee55528e1cbc47ef7e9f64186393eee40a49d9 (diff)
downloadcpython-0ade875ebe0d83709ec338616d6abe439c81f29b.tar.gz
cpython-0ade875ebe0d83709ec338616d6abe439c81f29b.zip
Add pair counts to stats output and summary. (GH-31324)
Diffstat (limited to 'Python')
-rw-r--r--Python/specialize.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index b54a2ecd506..0e1ffad1b91 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -174,13 +174,13 @@ print_spec_stats(FILE *out, OpcodeStats *stats)
{
/* Mark some opcodes as specializable for stats,
* even though we don't specialize them yet. */
- fprintf(out, " opcode[%d].specializable : 1\n", FOR_ITER);
- fprintf(out, " opcode[%d].specializable : 1\n", PRECALL_FUNCTION);
- fprintf(out, " opcode[%d].specializable : 1\n", PRECALL_METHOD);
- fprintf(out, " opcode[%d].specializable : 1\n", UNPACK_SEQUENCE);
+ fprintf(out, "opcode[%d].specializable : 1\n", FOR_ITER);
+ fprintf(out, "opcode[%d].specializable : 1\n", PRECALL_FUNCTION);
+ fprintf(out, "opcode[%d].specializable : 1\n", PRECALL_METHOD);
+ fprintf(out, "opcode[%d].specializable : 1\n", UNPACK_SEQUENCE);
for (int i = 0; i < 256; i++) {
if (adaptive_opcodes[i]) {
- fprintf(out, " opcode[%d].specializable : 1\n", i);
+ fprintf(out, "opcode[%d].specializable : 1\n", i);
}
PRINT_STAT(i, specialization.success);
PRINT_STAT(i, specialization.failure);
@@ -196,6 +196,12 @@ print_spec_stats(FILE *out, OpcodeStats *stats)
PRIu64 "\n", i, j, val);
}
}
+ for(int j = 0; j < 256; j++) {
+ if (stats[i].pair_count[j]) {
+ fprintf(out, "opcode[%d].pair_count[%d] : %" PRIu64 "\n",
+ i, j, stats[i].pair_count[j]);
+ }
+ }
}
}
#undef PRINT_STAT