summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-09 13:38:00 +0200
committerNoel Grandin <noel@peralex.com>2016-06-09 13:38:32 +0200
commit45913cd580ae5b01aade79936f2c4720d29e5b7a (patch)
treec586e9d0a9fe73b9f443556fbb20d79c393d54c1 /bin
parent258301879bcd20397c38bbd522dea2c923bd9fc2 (diff)
pretty up the output and add a sample string
Change-Id: I1c37b32e2127ba99b48b5ce3176e605f4e797475
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]]) )