mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] console: add new CONSOLE_FULL_BUFFERSIZE option
@ 2022-07-06 13:26 Marco Felsch
  0 siblings, 0 replies; only message in thread
From: Marco Felsch @ 2022-07-06 13:26 UTC (permalink / raw)
  To: barebox

Make the early printk buffer size adjustable since I noticed truncated
log buffers if I enable DEBUG_INITCALLS and DEBUG_PROBES.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 common/Kconfig   | 15 +++++++++++++++
 common/console.c |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index f7a6a96e87..365fef872f 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -761,6 +761,21 @@ config CONSOLE_NONE
 
 endchoice
 
+if CONSOLE_FULL
+
+config CONSOLE_FULL_BUFFERSIZE
+	int
+	prompt "Console buffer size in Bytes"
+	default 1024
+	help
+	  Size Bytes of the early console buffer. This buffer is used
+	  before malloc is intialized. In rare cases the buffer is to
+	  small to hold all early messages e.g. if DEBUG_INITCALLS and
+	  DEBUG_PROBES are enabled. In such cases you can adapt the size
+	  by the option, if unsure don't change it.
+
+endif
+
 choice
 	prompt "Console activation strategy"
 	depends on CONSOLE_FULL
diff --git a/common/console.c b/common/console.c
index 8727b187cf..6c3c1f2b3c 100644
--- a/common/console.c
+++ b/common/console.c
@@ -36,7 +36,7 @@ EXPORT_SYMBOL(console_list);
 
 static int initialized = 0;
 
-#define CONSOLE_BUFFER_SIZE	1024
+#define CONSOLE_BUFFER_SIZE	CONFIG_CONSOLE_FULL_BUFFERSIZE
 
 static char console_input_buffer[CONSOLE_BUFFER_SIZE];
 static char console_output_buffer[CONSOLE_BUFFER_SIZE];
-- 
2.30.2




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-06 13:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 13:26 [PATCH] console: add new CONSOLE_FULL_BUFFERSIZE option Marco Felsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox