From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 03/11] intoduce dmesg to print the barebox printk to dmesg ring buffer
Date: Sat, 9 Mar 2013 11:25:58 +0100 [thread overview]
Message-ID: <20130309102558.GJ1906@pengutronix.de> (raw)
In-Reply-To: <1362743983-11462-3-git-send-email-plagnioj@jcrosoft.com>
On Fri, Mar 08, 2013 at 12:59:35PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> the size can be configured vai DMESG_KFIFO_OSIZE
>
> +int vprintk(const char *fmt, va_list args)
> +{
> + uint i, fi;
> + char printbuffer[CFG_PBSIZE];
> + char *s = printbuffer;
> + int level;
> +
> + /* For this to work, printbuffer must be larger than
> + * anything we ever want to print.
> + */
> + fi = i = vsprintf(printbuffer, fmt, args);
> +
> + level = printk_get_level(printbuffer);
> + if (level) {
> + s += 2;
> + fi -= 2;
> + kfifo_putc(dmesg_output_fifo, '<');
> + kfifo_putc(dmesg_output_fifo, level);
> + kfifo_putc(dmesg_output_fifo, '>');
> + }
> +
> + /* Print the string */
> + if (level <= printk_level + '0')
> + puts(s);
> +
> + kfifo_put(dmesg_output_fifo, s, fi);
When the buffer is full this drops the current message instead of the
oldest.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-03-09 10:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 21:54 [PATCH 00/11 v6] introduction of dmesg support Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 8:05 ` Jan Lübbe
2013-03-08 11:59 ` [PATCH 01/11] kfifo: introduce kfifo_dump_str to dump the fifo Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 11:59 ` [PATCH 02/11] console: switch to kfifo_dump_str Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 11:59 ` [PATCH 03/11] intoduce dmesg to print the barebox printk to dmesg ring buffer Jean-Christophe PLAGNIOL-VILLARD
2013-03-09 10:25 ` Sascha Hauer [this message]
2013-03-08 11:59 ` [PATCH 04/11] startup: switch to pr_xxx Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 11:59 ` [PATCH 05/11] at91: clock switch to pr_info Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 11:59 ` [PATCH 06/11] meminfo: switch to pr_xxx Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 11:59 ` [PATCH 07/11] net/console: " Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 17:25 ` Sascha Hauer
2013-03-08 17:43 ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-09 10:19 ` Sascha Hauer
2013-03-08 11:59 ` [PATCH 08/11] startup: " Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 11:59 ` [PATCH 09/11] barebox_banner: switch to pr_info Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 11:59 ` [PATCH 10/11] net/phy: convert " Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 11:59 ` [PATCH 11/11] ext4: switch debug and printf to dev_xxx 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=20130309102558.GJ1906@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=plagnioj@jcrosoft.com \
/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