From: Roland Hieber <r.hieber@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] drivers: caam: add RNG software self-test
Date: Thu, 29 Nov 2018 15:11:00 +0100 [thread overview]
Message-ID: <20181129141100.yhexyeerzlqdwo3s@pengutronix.de> (raw)
In-Reply-To: <20181126105347.dlfdxjwdas3s57ia@pengutronix.de>
On Mon, Nov 26, 2018 at 11:53:47AM +0100, Roland Hieber wrote:
> > > + pr_vdebug("Result\n");
> > > + for (i = 0; i < RESULT_SIZE; i++) {
> > > + pr_vdebug("%02X\n", result[i]);
> > > + }
> > > +
> > > + pr_vdebug("Expected Result:\n");
> > > + for (i = 0; i < RESULT_SIZE; i++) {
> > > + pr_vdebug("%02X\n", exp_result[i]);
> > > + }
> >
> > Use memory_display to display this. Also this is only interesting if
> > both differ, so better print it in the failure path.
>
> I thought about that too, but I didn't see a way to make memory_display
> use pr_vdebug, or otherwise make its output depend on the debug level.
I have several solutions in mind: one would be to introduce a function
log_level() to get the current log level and decide on that whether to
call memory_display. However then memory dump won't pick up the pr_*
prefixes and use plain printf nevertheless. So my second thought is to
add a callback function to memory_display to pass pr_debug or else to it
which it can use to print stuff. However then we need to remodel
memory_display so it always prints full lines (or uses pr_cont which it
would need to know about, and you wanted to get rid of pr_cont anyway).
We could also use a third way and implement a custom printf escape, say
%md, that gets replaced with memory_display output when calling
pr_printk, and move the core formatting of memory_display into a helper.
I'm not sure which one is best.
- Roland
--
Roland Hieber | r.hieber@pengutronix.de |
Pengutronix e.K. | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
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:[~2018-11-29 14:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-25 22:59 Roland Hieber
2018-11-25 22:59 ` [PATCH 2/2] i.MX: HABv4: always print HAB status at boot time Roland Hieber
2018-11-26 7:56 ` Denis OSTERLAND
2018-12-03 10:17 ` Denis OSTERLAND
2018-11-26 9:01 ` [PATCH 1/2] drivers: caam: add RNG software self-test Sascha Hauer
2018-11-26 10:53 ` Roland Hieber
2018-11-29 14:11 ` Roland Hieber [this message]
2018-12-03 7:45 ` Sascha Hauer
2018-12-03 9:41 ` Roland Hieber
2018-11-29 10:17 ` Roland Hieber
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=20181129141100.yhexyeerzlqdwo3s@pengutronix.de \
--to=r.hieber@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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