aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorJack Miller <jack@codezen.org>2016-11-08 13:52:55 -0600
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-12-14 17:23:05 +1100
commitf2cc6ae4c9a4bc1a3f50a0138d4d5a43346ccb50 (patch)
treebcca51ac8e24533777ece01d6be8c97363d57385 /external
parent3e6e795cd5e8728f5fd7437b6aeea27b6adb3ed4 (diff)
downloadskiboot-f2cc6ae4c9a4bc1a3f50a0138d4d5a43346ccb50.zip
skiboot-f2cc6ae4c9a4bc1a3f50a0138d4d5a43346ccb50.tar.gz
skiboot-f2cc6ae4c9a4bc1a3f50a0138d4d5a43346ccb50.tar.bz2
external/fwts: Add 'last-tag' to FWTS olog output
This isn't so useful at the moment, but this will make cleaning out crufty old error definitions much easier. Signed-off-by: Jack Miller <jack@codezen.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rwxr-xr-xexternal/fwts/generate-fwts-olog17
1 files changed, 12 insertions, 5 deletions
diff --git a/external/fwts/generate-fwts-olog b/external/fwts/generate-fwts-olog
index 904531a..02a9a50 100755
--- a/external/fwts/generate-fwts-olog
+++ b/external/fwts/generate-fwts-olog
@@ -21,6 +21,7 @@ import sys
import string
import json
import argparse
+import subprocess
from pyparsing import Regex, Literal, Word, Combine, OneOrMore, QuotedString, \
lineno
@@ -160,7 +161,7 @@ def message_to_pattern(loc, msg):
return (compare_mode, pattern)
-def parse_patterns(parser, fname):
+def parse_patterns(parser, fname, tag):
patterns = []
data = open(fname).read()
i = 1
@@ -179,6 +180,7 @@ def parse_patterns(parser, fname):
'log_level': log_level_to_fwts(level),
'compare_mode': compare_mode,
'pattern': pattern_str,
+ 'last_tag': tag,
}
pattern.update(annotations)
@@ -192,7 +194,7 @@ def parse_patterns(parser, fname):
warn(loc, "missing advice")
allowed_data = ['compare_mode', 'log_level',
- 'pattern', 'advice', 'label']
+ 'pattern', 'advice', 'label', 'last_tag']
extras = set(pattern.keys()) - set(allowed_data)
if extras:
warn(loc, "unknown pattern annotation: %s" %
@@ -217,12 +219,17 @@ if __name__ == '__main__':
sources = []
for directory in args.directories:
- sources.extend(find_sources(directory))
+ try:
+ git_tag = subprocess.check_output(["git","-C", directory, "describe", "--abbrev=0" ])
+ except:
+ git_tag = "???"
+ git_tag = git_tag.replace("\n", "")
+ sources.extend([ (x, git_tag) for x in find_sources(directory)])
parser = create_parser()
patterns = []
- for source in sources:
- patterns.extend(parse_patterns(parser, source))
+ for source, tag in sources:
+ patterns.extend(parse_patterns(parser, source, tag))
data = {'olog_error_warning_patterns': patterns}