[Skiboot] [PATCH] generate-fwts-olog: add support for parsing prerror()
Stewart Smith
stewart at linux.vnet.ibm.com
Fri Dec 23 14:48:31 AEDT 2016
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
external/fwts/generate-fwts-olog | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/external/fwts/generate-fwts-olog b/external/fwts/generate-fwts-olog
index 02a9a50e242d..d1088232680f 100755
--- a/external/fwts/generate-fwts-olog
+++ b/external/fwts/generate-fwts-olog
@@ -41,10 +41,10 @@ def create_parser():
re.DOTALL)
# Match the following prlog() call
- log_call = (Literal("prlog") +
- Literal('(').suppress() +
- Word(string.letters + string.digits + '_') +
- Literal(',').suppress() +
+ log_call = (((Literal("prerror") + Literal('(').suppress()) |
+ (Literal("prlog") + Literal('(').suppress() +
+ Word(string.letters + string.digits + '_') +
+ Literal(',').suppress())) +
Combine(OneOrMore(QuotedString('"')), adjacent=False) +
(Literal(')') | Literal(',')).suppress()
)
@@ -167,11 +167,15 @@ def parse_patterns(parser, fname, tag):
i = 1
for result in parser.scanString(data):
(token, loc, _) = result
- (annotations, logfn, level, msg) = token
+ if token[1] == 'prlog':
+ (annotations, logfn, level, msg) = token
+ else:
+ (annotations, logfn, msg) = token
+ level = 'PR_ERR'
loc = (fname, lineno(loc, data))
- if logfn != 'prlog':
+ if logfn != 'prlog' and logfn != 'prerror':
warn(loc, "unknown log output function '%s'" % logfn)
compare_mode, pattern_str = message_to_pattern(loc, msg)
--
2.1.4
More information about the Skiboot
mailing list