summaryrefslogtreecommitdiffstats
path: root/Include/cpython/pystats.h
diff options
context:
space:
mode:
authorMichael Droettboom <mdboom@gmail.com>2024-01-25 11:10:51 (GMT)
committerGitHub <noreply@github.com>2024-01-25 11:10:51 (GMT)
commitea3cd0498c443e93be441736c804258e93d21edd (patch)
treeab975dc0fe8c933fd2c197275a7d9fc6598aa04b /Include/cpython/pystats.h
parentc63c6142f9146e1e977f4c824c56e8979e6aca87 (diff)
downloadcpython-ea3cd0498c443e93be441736c804258e93d21edd.zip
cpython-ea3cd0498c443e93be441736c804258e93d21edd.tar.gz
cpython-ea3cd0498c443e93be441736c804258e93d21edd.tar.bz2
gh-114312: Collect stats for unlikely events (GH-114493)
Diffstat (limited to 'Include/cpython/pystats.h')
-rw-r--r--Include/cpython/pystats.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Include/cpython/pystats.h b/Include/cpython/pystats.h
index ba67eef..bf0cfe4 100644
--- a/Include/cpython/pystats.h
+++ b/Include/cpython/pystats.h
@@ -122,11 +122,25 @@ typedef struct _optimization_stats {
uint64_t optimized_trace_length_hist[_Py_UOP_HIST_SIZE];
} OptimizationStats;
+typedef struct _rare_event_stats {
+ /* Setting an object's class, obj.__class__ = ... */
+ uint64_t set_class;
+ /* Setting the bases of a class, cls.__bases__ = ... */
+ uint64_t set_bases;
+ /* Setting the PEP 523 frame eval function, _PyInterpreterState_SetFrameEvalFunc() */
+ uint64_t set_eval_frame_func;
+ /* Modifying the builtins, __builtins__.__dict__[var] = ... */
+ uint64_t builtin_dict;
+ /* Modifying a function, e.g. func.__defaults__ = ..., etc. */
+ uint64_t func_modification;
+} RareEventStats;
+
typedef struct _stats {
OpcodeStats opcode_stats[256];
CallStats call_stats;
ObjectStats object_stats;
OptimizationStats optimization_stats;
+ RareEventStats rare_event_stats;
GCStats *gc_stats;
} PyStats;