[debug] allow to specify maxlevel to gc_info stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 11 Mar 2010 19:07:45 +0100
branchstable
changeset 4870 101858d845f7
parent 4868 e34cbd85d14d
child 4871 a34b76593ab2
[debug] allow to specify maxlevel to gc_info
_gcdebug.py
--- a/_gcdebug.py	Thu Mar 11 16:49:59 2010 +0100
+++ b/_gcdebug.py	Thu Mar 11 19:07:45 2010 +0100
@@ -22,7 +22,7 @@
 
 def gc_info(countclasses,
             ignoreclasses=IGNORE_CLASSES,
-            viewreferrersclasses=(), showobjs=False):
+            viewreferrersclasses=(), showobjs=False, maxlevel=1):
     gc.collect()
     gc.collect()
     counters = {}
@@ -45,7 +45,7 @@
             except KeyError:
                 ocounters[key] = 1
         if isinstance(obj, viewreferrersclasses):
-            print '   ', obj, referrers(obj, showobjs)
+            print '   ', obj, referrers(obj, showobjs, maxlevel)
     return counters, ocounters, gc.garbage