Created
July 30, 2012 13:41
-
-
Save jpetazzo/3206987 to your computer and use it in GitHub Desktop.
Analyze dmesg kernel stack traces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
We're looking for stuff like this: | |
dump_header+0x92/0x200 | |
""" | |
import re | |
import sys | |
data = sys.stdin.read() | |
counters = {} | |
matches = re.findall(r' [a-z_]+\+0x[0-9]+/', data) | |
for m in matches: | |
if m not in counters: | |
counters[m] = 0 | |
counters[m] += 1 | |
sorted_counters = sorted((c,m) for (m,c) in counters.items()) | |
for c in sorted_counters: | |
print c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment