summaryrefslogtreecommitdiffstats
path: root/common/console_common.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-07-08 09:47:09 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-07-09 10:20:28 +0200
commit297ac72881b89d34f7940020319fd3e2a68fbe67 (patch)
tree542d39ba08f524475b55d06385d84522456f3a45 /common/console_common.c
parenta34fd3272a88101483f74a608b07db4312a64015 (diff)
downloadbarebox-297ac72881b89d34f7940020319fd3e2a68fbe67.tar.gz
barebox-297ac72881b89d34f7940020319fd3e2a68fbe67.tar.xz
pstore: Only capture log messages
With this pstore only captures barebox log messages printed with pr_* and dev_*, but no longer anything printed with printf and friends. When capturing the barebox output with pstore only the log messages are of interest, but not the ones printed with printf and certainly not the things typed interactively on the command line. These are logged currently because we register pstore as a barebox console. Instead, hook into pr_puts which only outputs the barebox log messages. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/console_common.c')
-rw-r--r--common/console_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/console_common.c b/common/console_common.c
index a4d2636753..6916f651e5 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -29,6 +29,7 @@
#include <password.h>
#include <clock.h>
#include <malloc.h>
+#include <linux/pstore.h>
#include <asm-generic/div64.h>
#ifndef CONFIG_CONSOLE_NONE
@@ -116,7 +117,10 @@ static void pr_puts(int level, const char *str)
barebox_logbuf_num_messages++;
}
}
+
+ pstore_log(str);
nolog:
+
if (level > barebox_loglevel)
return;