summaryrefslogtreecommitdiffstats
path: root/Include/cpython
diff options
context:
space:
mode:
authorMichael Droettboom <mdboom@gmail.com>2023-10-04 21:52:28 (GMT)
committerGitHub <noreply@github.com>2023-10-04 21:52:28 (GMT)
commite561e9805854980a61967d07869b4ec4205b32c8 (patch)
tree4cf341fc0bf0091ad1b3e7eb034699b23a4ae851 /Include/cpython
parentf7860295b16a402621e209871c8eaeeea16f464e (diff)
downloadcpython-e561e9805854980a61967d07869b4ec4205b32c8.zip
cpython-e561e9805854980a61967d07869b4ec4205b32c8.tar.gz
cpython-e561e9805854980a61967d07869b4ec4205b32c8.tar.bz2
GH-109329: Add tier 2 stats (GH-109913)
Diffstat (limited to 'Include/cpython')
-rw-r--r--Include/cpython/pystats.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/Include/cpython/pystats.h b/Include/cpython/pystats.h
index 150e16f..056406e 100644
--- a/Include/cpython/pystats.h
+++ b/Include/cpython/pystats.h
@@ -86,10 +86,6 @@ typedef struct _object_stats {
uint64_t type_cache_dunder_hits;
uint64_t type_cache_dunder_misses;
uint64_t type_cache_collisions;
- uint64_t optimization_attempts;
- uint64_t optimization_traces_created;
- uint64_t optimization_traces_executed;
- uint64_t optimization_uops_executed;
/* Temporary value used during GC */
uint64_t object_visits;
} ObjectStats;
@@ -100,10 +96,34 @@ typedef struct _gc_stats {
uint64_t objects_collected;
} GCStats;
+typedef struct _uop_stats {
+ uint64_t execution_count;
+} UOpStats;
+
+#define _Py_UOP_HIST_SIZE 32
+
+typedef struct _optimization_stats {
+ uint64_t attempts;
+ uint64_t traces_created;
+ uint64_t traces_executed;
+ uint64_t uops_executed;
+ uint64_t trace_stack_overflow;
+ uint64_t trace_stack_underflow;
+ uint64_t trace_too_long;
+ uint64_t inner_loop;
+ uint64_t recursive_call;
+ UOpStats opcode[512];
+ uint64_t unsupported_opcode[256];
+ uint64_t trace_length_hist[_Py_UOP_HIST_SIZE];
+ uint64_t trace_run_length_hist[_Py_UOP_HIST_SIZE];
+ uint64_t optimized_trace_length_hist[_Py_UOP_HIST_SIZE];
+} OptimizationStats;
+
typedef struct _stats {
OpcodeStats opcode_stats[256];
CallStats call_stats;
ObjectStats object_stats;
+ OptimizationStats optimization_stats;
GCStats *gc_stats;
} PyStats;