mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/9] intoduce dmesg to print the barebox output ring buffer
Date: Thu, 13 Dec 2012 17:40:04 +0100	[thread overview]
Message-ID: <1355416810-26555-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1355416810-26555-1-git-send-email-plagnioj@jcrosoft.com>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 commands/Kconfig |    6 ++++++
 common/console.c |   20 ++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/commands/Kconfig b/commands/Kconfig
index ac9b797..55a9840 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -115,6 +115,12 @@ config CMD_TIME
 	  checking for ctrl-c, so the time command can be used with commands
 	  which are interruptible with ctrl-c.
 
+config CMD_DMESG
+	bool "dmesg"
+	depends on CONSOLE_FULL
+	  help
+	  print the barebox output ring buffer
+
 config CMD_LINUX_EXEC
 	bool "linux exec"
 	depends on LINUX
diff --git a/common/console.c b/common/console.c
index 96e1396..2d2d20a 100644
--- a/common/console.c
+++ b/common/console.c
@@ -434,3 +434,23 @@ int ctrlc (void)
 }
 EXPORT_SYMBOL(ctrlc);
 #endif /* ARCH_HAS_CTRC */
+
+#include <command.h>
+#include <complete.h>
+
+static int do_dmesg(int argc, char *argv[])
+{
+	kfifo_dump_str(console_output_fifo, console_output_dump);
+
+	return 0;
+}
+
+static const __maybe_unused char cmd_dmesg_help[] =
+"print the barebox output ring buffer\n";
+
+BAREBOX_CMD_START(dmesg)
+	.cmd		= do_dmesg,
+	.usage		= "dmesg",
+	BAREBOX_CMD_HELP(cmd_dmesg_help)
+	BAREBOX_CMD_COMPLETE(empty_complete)
+BAREBOX_CMD_END
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-12-13 16:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13 16:37 [PATCH 0/9] introduction of dmesg support Jean-Christophe PLAGNIOL-VILLARD
2012-12-13 16:40 ` [PATCH 1/9] kfifo: introduce kfifo_dump_str to dump the fifo Jean-Christophe PLAGNIOL-VILLARD
2012-12-13 16:40   ` [PATCH 2/9] console: switch to kfifo_dump_str Jean-Christophe PLAGNIOL-VILLARD
2012-12-13 16:40   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-12-13 16:40   ` [PATCH 4/9] introduce printk support Jean-Christophe PLAGNIOL-VILLARD
2012-12-14 23:07     ` Sascha Hauer
2012-12-17  7:26       ` Jean-Christophe PLAGNIOL-VILLARD
2012-12-13 16:40   ` [PATCH 5/9] startup: switch to pr_xxx Jean-Christophe PLAGNIOL-VILLARD
2012-12-13 16:40   ` [PATCH 6/9] console: allow to specify ouput kfifo size via CONSOLE_KFIFO_OUTPUT_SIZE Jean-Christophe PLAGNIOL-VILLARD
2012-12-13 16:40   ` [PATCH 7/9] at91: clock switch to pr_info Jean-Christophe PLAGNIOL-VILLARD
2012-12-13 16:40   ` [PATCH 8/9] meminfo: switch to pr_xxx Jean-Christophe PLAGNIOL-VILLARD
2012-12-13 16:40   ` [PATCH 9/9] dev_printf: switch to pr_info Jean-Christophe PLAGNIOL-VILLARD
2012-12-14 22:49   ` [PATCH 1/9] kfifo: introduce kfifo_dump_str to dump the fifo Sascha Hauer
2012-12-17  7:23     ` Jean-Christophe PLAGNIOL-VILLARD
2012-12-14 23:15 ` [PATCH 0/9] introduction of dmesg support Sascha Hauer
2012-12-17  7:22   ` Jean-Christophe PLAGNIOL-VILLARD

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=1355416810-26555-3-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --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