Skip to content

Commit 8e9333e

Browse files
committed
Revert "[3.13] pythonGH-122298: Restore printing of GC stats (pythonGH-123261) (python#123268)"
This reverts commit b1372e2.
1 parent 95fe67e commit 8e9333e

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

Python/gc.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,6 @@ gc_collect_young(PyThreadState *tstate,
12891289
GCState *gcstate = &tstate->interp->gc;
12901290
PyGC_Head *young = &gcstate->young.head;
12911291
PyGC_Head *visited = &gcstate->old[gcstate->visited_space].head;
1292-
GC_STAT_ADD(0, collections, 1);
12931292
#ifdef Py_STATS
12941293
{
12951294
Py_ssize_t count = 0;
@@ -1418,7 +1417,6 @@ completed_cycle(GCState *gcstate)
14181417
static void
14191418
gc_collect_increment(PyThreadState *tstate, struct gc_collection_stats *stats)
14201419
{
1421-
GC_STAT_ADD(1, collections, 1);
14221420
GCState *gcstate = &tstate->interp->gc;
14231421
PyGC_Head *not_visited = &gcstate->old[gcstate->visited_space^1].head;
14241422
PyGC_Head *visited = &gcstate->old[gcstate->visited_space].head;
@@ -1464,7 +1462,6 @@ static void
14641462
gc_collect_full(PyThreadState *tstate,
14651463
struct gc_collection_stats *stats)
14661464
{
1467-
GC_STAT_ADD(2, collections, 1);
14681465
GCState *gcstate = &tstate->interp->gc;
14691466
validate_old(gcstate);
14701467
PyGC_Head *young = &gcstate->young.head;
@@ -1787,24 +1784,6 @@ PyGC_IsEnabled(void)
17871784
return gcstate->enabled;
17881785
}
17891786

1790-
// Show stats for objects in each generations
1791-
static void
1792-
show_stats_each_generations(GCState *gcstate)
1793-
{
1794-
char buf[100];
1795-
size_t pos = 0;
1796-
1797-
for (int i = 0; i < NUM_GENERATIONS && pos < sizeof(buf); i++) {
1798-
pos += PyOS_snprintf(buf+pos, sizeof(buf)-pos,
1799-
" %zd",
1800-
gc_list_size(GEN_HEAD(gcstate, i)));
1801-
}
1802-
PySys_FormatStderr(
1803-
"gc: objects in each generation:%s\n"
1804-
"gc: objects in permanent generation: %zd\n",
1805-
buf, gc_list_size(&gcstate->permanent_generation.head));
1806-
}
1807-
18081787
Py_ssize_t
18091788
_PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason)
18101789
{
@@ -1820,10 +1799,6 @@ _PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason)
18201799
if (reason != _Py_GC_REASON_SHUTDOWN) {
18211800
invoke_gc_callback(gcstate, "start", generation, &stats);
18221801
}
1823-
if (gcstate->debug & _PyGC_DEBUG_STATS) {
1824-
PySys_WriteStderr("gc: collecting generation %d...\n", generation);
1825-
show_stats_each_generations(gcstate);
1826-
}
18271802
if (PyDTrace_GC_START_ENABLED()) {
18281803
PyDTrace_GC_START(generation);
18291804
}

0 commit comments

Comments
 (0)