summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/find-most-common-warn-messages.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/find-most-common-warn-messages.py b/bin/find-most-common-warn-messages.py
index 3cbf2114041b..d89a8873fa4d 100755
--- a/bin/find-most-common-warn-messages.py
+++ b/bin/find-most-common-warn-messages.py
@@ -14,6 +14,7 @@ process = subprocess.Popen("find workdir -name '*.log' | xargs grep -h 'warn:' |
shell=True, stdout=subprocess.PIPE, universal_newlines=True)
messages = dict() # dict of sourceAndLine->count
+sampleOfMessage = dict() # dict of sourceAndLine->string
for line in process.stdout:
line = line.strip()
# a sample line is:
@@ -24,12 +25,13 @@ for line in process.stdout:
messages[sourceAndLine] = messages[sourceAndLine] + 1
else:
messages[sourceAndLine] = 1
+ sampleOfMessage[sourceAndLine] = tokens[6]
tmplist = list() # set of tuple (count, sourceAndLine)
for key, value in messages.iteritems():
tmplist.append([value,key])
for i in sorted(tmplist, key=lambda v: v[0]):
- print i
+ print( "%6d %s %s" % (i[0], i[1], sampleOfMessage[i[1]]) )