aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/debug/core/chttp2_ref_leak.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/debug/core/chttp2_ref_leak.py')
-rwxr-xr-xtools/debug/core/chttp2_ref_leak.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/debug/core/chttp2_ref_leak.py b/tools/debug/core/chttp2_ref_leak.py
index d693dd9e54..a6a5448775 100755
--- a/tools/debug/core/chttp2_ref_leak.py
+++ b/tools/debug/core/chttp2_ref_leak.py
@@ -20,8 +20,10 @@ import collections
import sys
import re
+
def new_obj():
- return ['destroy']
+ return ['destroy']
+
outstanding = collections.defaultdict(new_obj)
@@ -29,14 +31,14 @@ outstanding = collections.defaultdict(new_obj)
# chttp2:unref:0x629000005200 2->1 destroy [src/core/ext/transport/chttp2/transport/chttp2_transport.c:599]
for line in sys.stdin:
- m = re.search(r'chttp2:( ref|unref):0x([a-fA-F0-9]+) [^ ]+ ([^[]+) \[(.*)\]', line)
- if m:
- if m.group(1) == ' ref':
- outstanding[m.group(2)].append(m.group(3))
- else:
- outstanding[m.group(2)].remove(m.group(3))
+ m = re.search(
+ r'chttp2:( ref|unref):0x([a-fA-F0-9]+) [^ ]+ ([^[]+) \[(.*)\]', line)
+ if m:
+ if m.group(1) == ' ref':
+ outstanding[m.group(2)].append(m.group(3))
+ else:
+ outstanding[m.group(2)].remove(m.group(3))
for obj, remaining in outstanding.items():
- if remaining:
- print 'LEAKED: %s %r' % (obj, remaining)
-
+ if remaining:
+ print 'LEAKED: %s %r' % (obj, remaining)