mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
GH-90230: Add stats to breakdown the origin of calls to PyEval_EvalFrame
(GH-93284)
This commit is contained in:
parent
8995177030
commit
bbcf42449e
13 changed files with 63 additions and 11 deletions
|
@ -265,6 +265,9 @@ extern int _PyStaticCode_InternStrings(PyCodeObject *co);
|
|||
#define OBJECT_STAT_INC(name) _py_stats.object_stats.name++
|
||||
#define OBJECT_STAT_INC_COND(name, cond) \
|
||||
do { if (cond) _py_stats.object_stats.name++; } while (0)
|
||||
#define EVAL_CALL_STAT_INC(name) _py_stats.call_stats.eval_calls[name]++
|
||||
#define EVAL_CALL_STAT_INC_IF_FUNCTION(name, callable) \
|
||||
do { if (PyFunction_Check(callable)) _py_stats.call_stats.eval_calls[name]++; } while (0)
|
||||
|
||||
// Used by the _opcode extension which is built as a shared library
|
||||
PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
|
||||
|
@ -276,6 +279,8 @@ PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
|
|||
#define CALL_STAT_INC(name) ((void)0)
|
||||
#define OBJECT_STAT_INC(name) ((void)0)
|
||||
#define OBJECT_STAT_INC_COND(name, cond) ((void)0)
|
||||
#define EVAL_CALL_STAT_INC(name) ((void)0)
|
||||
#define EVAL_CALL_STAT_INC_IF_FUNCTION(name, callable) ((void)0)
|
||||
#endif // !Py_STATS
|
||||
|
||||
// Cache values are only valid in memory, so use native endianness.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue