From 08cd8c04ab4a83db88fced754a39f8ab269bf7d6 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 27 Sep 2023 10:19:52 -0400 Subject: [PATCH] Disable Tier 1 stats in Tier 2 --- Python/executor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Python/executor.c b/Python/executor.c index 48e9f2b42df8ff..e509cfb1144a1d 100644 --- a/Python/executor.c +++ b/Python/executor.c @@ -31,6 +31,16 @@ goto deoptimize; \ } +#ifdef Py_STATS +// Disable these macros that apply to Tier 1 stats when we are in Tier 2 +#undef STAT_INC +#define STAT_INC(opname, name) ((void)0) +#undef STAT_DEC +#define STAT_DEC(opname, name) ((void)0) +#undef CALL_STAT_INC +#define CALL_STAT_INC(name) ((void)0) +#endif + #undef ENABLE_SPECIALIZATION #define ENABLE_SPECIALIZATION 0