diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2017-06-06 09:05:02 +0800 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-06 17:59:45 +1000 |
commit | 20585eeeab83b2f0d24ab76986ff5d4ab0ed2e92 (patch) | |
tree | 1be9bdc585f0c9593de8c769c608f92c15a7a349 /external | |
parent | 98d32d5ffb80b8213c2055364e0806c641e90edd (diff) | |
download | skiboot-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.c | 20 |
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) |