From 1583c6e326a8454d3c806763620e1329bf6b7cbe Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 12 Dec 2022 09:50:43 -0500 Subject: 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 --- Python/specialize.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Python/specialize.c') diff --git a/Python/specialize.c b/Python/specialize.c index 7545a77124..785088eac8 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); } -- cgit v1.2.1