summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorMichael Droettboom <mdboom@gmail.com>2022-12-12 14:50:43 (GMT)
committerGitHub <noreply@github.com>2022-12-12 14:50:43 (GMT)
commit1583c6e326a8454d3c806763620e1329bf6b7cbe (patch)
treed18e4187fa1f991f73d730439325e1532f6ee001 /Python/specialize.c
parente4ea33b17807d99ed737f800d9b0006957c008d2 (diff)
downloadcpython-1583c6e326a8454d3c806763620e1329bf6b7cbe.zip
cpython-1583c6e326a8454d3c806763620e1329bf6b7cbe.tar.gz
cpython-1583c6e326a8454d3c806763620e1329bf6b7cbe.tar.bz2
GH-100143: Improve collecting pystats for parts of runs (GH-100144)
* pystats off by default * Add -Xpystats flag * Always dump pystats, even if turned off
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index 7545a77..785088e 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -18,7 +18,7 @@
#ifdef Py_STATS
PyStats _py_stats_struct = { 0 };
-PyStats *_py_stats = &_py_stats_struct;
+PyStats *_py_stats = NULL;
#define ADD_STAT_TO_DICT(res, field) \
do { \
@@ -205,9 +205,6 @@ _Py_StatsClear(void)
void
_Py_PrintSpecializationStats(int to_file)
{
- if (_py_stats == NULL) {
- return;
- }
FILE *out = stderr;
if (to_file) {
/* Write to a file instead of stderr. */
@@ -238,7 +235,7 @@ _Py_PrintSpecializationStats(int to_file)
else {
fprintf(out, "Specialization stats:\n");
}
- print_stats(out, _py_stats);
+ print_stats(out, &_py_stats_struct);
if (out != stderr) {
fclose(out);
}