mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] console: add new CONSOLE_FULL_BUFFERSIZE option
Date: Wed,  6 Jul 2022 15:26:37 +0200	[thread overview]
Message-ID: <20220706132637.2170562-1-m.felsch@pengutronix.de> (raw)

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




                 reply	other threads:[~2022-07-06 13:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220706132637.2170562-1-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox