Skip to content

Instantly share code, notes, and snippets.



Created Sep 6, 2017
What would you like to do?
import fileinput
import re
r = re.compile('^\s*\d+\s*([^\s]+)')
rsp_r = re.compile('rsp\s=\s(0x[a-f0-9]+)')
prev_fn = None
this_fn = None
prev_rsp = None
for line in fileinput.input():
m = r.match(line)
if m:
prev_fn = this_fn
this_fn =
m =
if m:
rsp = int(, 16)
if prev_rsp is not None:
size = rsp - prev_rsp
print '%d %s' % (size, prev_fn)
prev_fn = this_fn
prev_rsp = rsp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment