aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2017-06-06 09:05:02 +0800
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-06 17:59:45 +1000
commit20585eeeab83b2f0d24ab76986ff5d4ab0ed2e92 (patch)
tree1be9bdc585f0c9593de8c769c608f92c15a7a349 /external
parent98d32d5ffb80b8213c2055364e0806c641e90edd (diff)
downloadskiboot-20585eeeab83b2f0d24ab76986ff5d4ab0ed2e92.zip
skiboot-20585eeeab83b2f0d24ab76986ff5d4ab0ed2e92.tar.gz
skiboot-20585eeeab83b2f0d24ab76986ff5d4ab0ed2e92.tar.bz2
opal-prd: interpret log level prefixes from HBRT
Interpret the (optional) *_MRK log prefixes on HBRT messages, and set the syslog log priority to suit. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/opal-prd/opal-prd.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index d3c83b7..7113a35 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -270,7 +270,25 @@ extern int call_run_command(int argc, const char **argv, char **o_outString);
void hservice_puts(const char *str)
{
- pr_log(LOG_INFO, "HBRT: %s", str);
+ int priority = LOG_INFO;
+
+ /* Interpret the 2-character ERR_MRK/FAIL_MRK/WARN_MRK prefixes that
+ * may be present on HBRT log messages, and bump the log priority as
+ * appropriate.
+ */
+ if (strlen(str) >= 2 && str[1] == '>') {
+ switch (str[0]) {
+ case 'E':
+ case 'F':
+ priority = LOG_ERR;
+ break;
+ case 'W':
+ priority = LOG_WARNING;
+ break;
+ }
+ }
+
+ pr_log(priority, "HBRT: %s", str);
}
void hservice_assert(void)