* [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
@ 2011-07-18 13:06 Antony Pavlov
2011-07-18 13:06 ` [PATCH v2 2/2] startup.c: make DEBUG_LL output more useful Antony Pavlov
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Antony Pavlov @ 2011-07-18 13:06 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
include/debug_ll.h | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/include/debug_ll.h b/include/debug_ll.h
index e99ae7d..6b1b174 100644
--- a/include/debug_ll.h
+++ b/include/debug_ll.h
@@ -35,9 +35,22 @@
ch = ((v >> (i*4)) & 0xf);\
ch += (ch >= 10) ? 'a' - 10 : '0';\
PUTC_LL (ch); }})
+
+static __inline__ void PUTS_LL(char * str)
+{
+ while (*str) {
+ if (*str == '\n') {
+ PUTC_LL('\r');
+ }
+ PUTC_LL(*str);
+ str++;
+ }
+}
+
#else
# define PUTC_LL(c) do {} while (0)
# define PUTHEX_LL(v) do {} while (0)
+# define PUTS_LL(c) do {} while (0)
#endif
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 2/2] startup.c: make DEBUG_LL output more useful
2011-07-18 13:06 [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Antony Pavlov
@ 2011-07-18 13:06 ` Antony Pavlov
2011-07-18 13:26 ` [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Franck JULLIEN
2011-07-18 21:04 ` Sascha Hauer
2 siblings, 0 replies; 10+ messages in thread
From: Antony Pavlov @ 2011-07-18 13:06 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
common/startup.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/common/startup.c b/common/startup.c
index 00bc9a0..2e28cb2 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -134,13 +134,17 @@ void start_barebox (void)
for (initcall = __barebox_initcalls_start;
initcall < __barebox_initcalls_end; initcall++) {
+ PUTS_LL("<<");
PUTHEX_LL(*initcall);
- PUTC_LL('\n');
result = (*initcall)();
+ PUTC_LL('>');
if (result)
hang();
+ PUTS_LL(">\n");
}
+ PUTS_LL("initcalls done\n");
+
display_meminfo();
#ifdef CONFIG_ENV_HANDLING
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
2011-07-18 13:06 [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Antony Pavlov
2011-07-18 13:06 ` [PATCH v2 2/2] startup.c: make DEBUG_LL output more useful Antony Pavlov
@ 2011-07-18 13:26 ` Franck JULLIEN
2011-07-18 13:35 ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 21:03 ` Sascha Hauer
2011-07-18 21:04 ` Sascha Hauer
2 siblings, 2 replies; 10+ messages in thread
From: Franck JULLIEN @ 2011-07-18 13:26 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
[-- Attachment #1.1: Type: text/plain, Size: 1369 bytes --]
2011/7/18 Antony Pavlov <antonynpavlov@gmail.com>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
> include/debug_ll.h | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/include/debug_ll.h b/include/debug_ll.h
> index e99ae7d..6b1b174 100644
> --- a/include/debug_ll.h
> +++ b/include/debug_ll.h
> @@ -35,9 +35,22 @@
> ch = ((v >> (i*4)) & 0xf);\
> ch += (ch >= 10) ? 'a' - 10 : '0';\
> PUTC_LL (ch); }})
> +
> +static __inline__ void PUTS_LL(char * str)
> +{
> + while (*str) {
> + if (*str == '\n') {
> + PUTC_LL('\r');
> + }
> + PUTC_LL(*str);
> + str++;
> + }
> +}
> +
> #else
> # define PUTC_LL(c) do {} while (0)
> # define PUTHEX_LL(v) do {} while (0)
> +# define PUTS_LL(c) do {} while (0)
>
> #endif
>
> --
> 1.7.5.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
Hello,
Could we add an entry for CONFIG_DEBUG_LL in the debugging menu
(common/Kconfig) ?
This file makes barebox not compile if we are not on arm arch due to the
<mach/debug_ll.h> inclusion.
I know it's not related to your patch :)
Franck.
[-- Attachment #1.2: Type: text/html, Size: 2119 bytes --]
[-- Attachment #2: Type: text/plain, Size: 149 bytes --]
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
2011-07-18 13:26 ` [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Franck JULLIEN
@ 2011-07-18 13:35 ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 13:59 ` Franck JULLIEN
2011-07-18 21:03 ` Sascha Hauer
1 sibling, 1 reply; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-07-18 13:35 UTC (permalink / raw)
To: Franck JULLIEN; +Cc: barebox
On 15:26 Mon 18 Jul , Franck JULLIEN wrote:
Franck could you stop to post in HTML and port in text/plain
Best Regards,
J.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
2011-07-18 13:35 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-18 13:59 ` Franck JULLIEN
0 siblings, 0 replies; 10+ messages in thread
From: Franck JULLIEN @ 2011-07-18 13:59 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
2011/7/18 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>
> On 15:26 Mon 18 Jul , Franck JULLIEN wrote:
> Franck could you stop to post in HTML and port in text/plain
>
Sorry my bad. I know you already asked to Antony to do so
and I thought I wasn't concerned :)
> Best Regards,
> J.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
2011-07-18 13:26 ` [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Franck JULLIEN
2011-07-18 13:35 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-07-18 21:03 ` Sascha Hauer
1 sibling, 0 replies; 10+ messages in thread
From: Sascha Hauer @ 2011-07-18 21:03 UTC (permalink / raw)
To: Franck JULLIEN; +Cc: barebox
On Mon, Jul 18, 2011 at 03:26:33PM +0200, Franck JULLIEN wrote:
> 2011/7/18 Antony Pavlov <antonynpavlov@gmail.com>
>
>
>
> Hello,
>
> Could we add an entry for CONFIG_DEBUG_LL in the debugging menu
> (common/Kconfig) ?
> This file makes barebox not compile if we are not on arm arch due to the
> <mach/debug_ll.h> inclusion.
>
> I know it's not related to your patch :)
Patches that make the lowlevel debug stuff more generally useful
are very welcome. It's not nice to have to modify the code to make
it work, but I couldn't find the energy to do something about it.
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
2011-07-18 13:06 [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Antony Pavlov
2011-07-18 13:06 ` [PATCH v2 2/2] startup.c: make DEBUG_LL output more useful Antony Pavlov
2011-07-18 13:26 ` [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Franck JULLIEN
@ 2011-07-18 21:04 ` Sascha Hauer
2011-07-19 13:14 ` Franck JULLIEN
2 siblings, 1 reply; 10+ messages in thread
From: Sascha Hauer @ 2011-07-18 21:04 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
On Mon, Jul 18, 2011 at 05:06:09PM +0400, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Applied both to next.
Thanks
Sascha
> ---
> include/debug_ll.h | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/include/debug_ll.h b/include/debug_ll.h
> index e99ae7d..6b1b174 100644
> --- a/include/debug_ll.h
> +++ b/include/debug_ll.h
> @@ -35,9 +35,22 @@
> ch = ((v >> (i*4)) & 0xf);\
> ch += (ch >= 10) ? 'a' - 10 : '0';\
> PUTC_LL (ch); }})
> +
> +static __inline__ void PUTS_LL(char * str)
> +{
> + while (*str) {
> + if (*str == '\n') {
> + PUTC_LL('\r');
> + }
> + PUTC_LL(*str);
> + str++;
> + }
> +}
> +
> #else
> # define PUTC_LL(c) do {} while (0)
> # define PUTHEX_LL(v) do {} while (0)
> +# define PUTS_LL(c) do {} while (0)
>
> #endif
>
> --
> 1.7.5.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
2011-07-18 21:04 ` Sascha Hauer
@ 2011-07-19 13:14 ` Franck JULLIEN
2011-07-20 6:51 ` Sascha Hauer
0 siblings, 1 reply; 10+ messages in thread
From: Franck JULLIEN @ 2011-07-19 13:14 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
2011/7/18 Sascha Hauer <s.hauer@pengutronix.de>:
> On Mon, Jul 18, 2011 at 05:06:09PM +0400, Antony Pavlov wrote:
>> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
>
> Applied both to next.
>
> Thanks
> Sascha
>
>> ---
>> include/debug_ll.h | 13 +++++++++++++
>> 1 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/debug_ll.h b/include/debug_ll.h
>> index e99ae7d..6b1b174 100644
>> --- a/include/debug_ll.h
>> +++ b/include/debug_ll.h
>> @@ -35,9 +35,22 @@
>> ch = ((v >> (i*4)) & 0xf);\
>> ch += (ch >= 10) ? 'a' - 10 : '0';\
>> PUTC_LL (ch); }})
>> +
>> +static __inline__ void PUTS_LL(char * str)
>> +{
>> + while (*str) {
>> + if (*str == '\n') {
>> + PUTC_LL('\r');
>> + }
>> + PUTC_LL(*str);
>> + str++;
>> + }
>> +}
>> +
>> #else
>> # define PUTC_LL(c) do {} while (0)
>> # define PUTHEX_LL(v) do {} while (0)
>> +# define PUTS_LL(c) do {} while (0)
>>
>> #endif
>>
Is there any reason for not using vsprintf in a printf_ll function
which would use puts_ll / putc_ll ??
Franck.
>> --
>> 1.7.5.4
>>
>>
>> _______________________________________________
>> barebox mailing list
>> barebox@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/barebox
>>
>
> --
> 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
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
2011-07-19 13:14 ` Franck JULLIEN
@ 2011-07-20 6:51 ` Sascha Hauer
2011-07-20 7:14 ` Franck JULLIEN
0 siblings, 1 reply; 10+ messages in thread
From: Sascha Hauer @ 2011-07-20 6:51 UTC (permalink / raw)
To: Franck JULLIEN; +Cc: barebox
On Tue, Jul 19, 2011 at 03:14:03PM +0200, Franck JULLIEN wrote:
> 2011/7/18 Sascha Hauer <s.hauer@pengutronix.de>:
> > On Mon, Jul 18, 2011 at 05:06:09PM +0400, Antony Pavlov wrote:
> >> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> >
> > Applied both to next.
> >
> > Thanks
> > Sascha
> >
> >> ---
> >> include/debug_ll.h | 13 +++++++++++++
> >> 1 files changed, 13 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/include/debug_ll.h b/include/debug_ll.h
> >> index e99ae7d..6b1b174 100644
> >> --- a/include/debug_ll.h
> >> +++ b/include/debug_ll.h
> >> @@ -35,9 +35,22 @@
> >> ch = ((v >> (i*4)) & 0xf);\
> >> ch += (ch >= 10) ? 'a' - 10 : '0';\
> >> PUTC_LL (ch); }})
> >> +
> >> +static __inline__ void PUTS_LL(char * str)
> >> +{
> >> + while (*str) {
> >> + if (*str == '\n') {
> >> + PUTC_LL('\r');
> >> + }
> >> + PUTC_LL(*str);
> >> + str++;
> >> + }
> >> +}
> >> +
> >> #else
> >> # define PUTC_LL(c) do {} while (0)
> >> # define PUTHEX_LL(v) do {} while (0)
> >> +# define PUTS_LL(c) do {} while (0)
> >>
> >> #endif
> >>
>
> Is there any reason for not using vsprintf in a printf_ll function
> which would use puts_ll / putc_ll ??
You would at least need a writable string buffer. I'd rather like to
keep the ll functions as simple as possible. Otherwise you end up
debugging the debug functions while hunting some lowlevel problem.
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function
2011-07-20 6:51 ` Sascha Hauer
@ 2011-07-20 7:14 ` Franck JULLIEN
0 siblings, 0 replies; 10+ messages in thread
From: Franck JULLIEN @ 2011-07-20 7:14 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
2011/7/20 Sascha Hauer <s.hauer@pengutronix.de>:
> On Tue, Jul 19, 2011 at 03:14:03PM +0200, Franck JULLIEN wrote:
>> 2011/7/18 Sascha Hauer <s.hauer@pengutronix.de>:
>> > On Mon, Jul 18, 2011 at 05:06:09PM +0400, Antony Pavlov wrote:
>> >> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
>> >
>> > Applied both to next.
>> >
>> > Thanks
>> > Sascha
>> >
>> >> ---
>> >> include/debug_ll.h | 13 +++++++++++++
>> >> 1 files changed, 13 insertions(+), 0 deletions(-)
>> >>
>> >> diff --git a/include/debug_ll.h b/include/debug_ll.h
>> >> index e99ae7d..6b1b174 100644
>> >> --- a/include/debug_ll.h
>> >> +++ b/include/debug_ll.h
>> >> @@ -35,9 +35,22 @@
>> >> ch = ((v >> (i*4)) & 0xf);\
>> >> ch += (ch >= 10) ? 'a' - 10 : '0';\
>> >> PUTC_LL (ch); }})
>> >> +
>> >> +static __inline__ void PUTS_LL(char * str)
>> >> +{
>> >> + while (*str) {
>> >> + if (*str == '\n') {
>> >> + PUTC_LL('\r');
>> >> + }
>> >> + PUTC_LL(*str);
>> >> + str++;
>> >> + }
>> >> +}
>> >> +
>> >> #else
>> >> # define PUTC_LL(c) do {} while (0)
>> >> # define PUTHEX_LL(v) do {} while (0)
>> >> +# define PUTS_LL(c) do {} while (0)
>> >>
>> >> #endif
>> >>
>>
>> Is there any reason for not using vsprintf in a printf_ll function
>> which would use puts_ll / putc_ll ??
>
> You would at least need a writable string buffer. I'd rather like to
> keep the ll functions as simple as possible. Otherwise you end up
> debugging the debug functions while hunting some lowlevel problem.
>
Ok I see, let's keep it like this. However, that's what I did in
nios2/lib/early_printf.c and I never
had any problem using a static 50 bytes buffer.
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-07-20 7:14 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-18 13:06 [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Antony Pavlov
2011-07-18 13:06 ` [PATCH v2 2/2] startup.c: make DEBUG_LL output more useful Antony Pavlov
2011-07-18 13:26 ` [PATCH v2 1/2] debug_ll.h: add PUTS_LL() function Franck JULLIEN
2011-07-18 13:35 ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 13:59 ` Franck JULLIEN
2011-07-18 21:03 ` Sascha Hauer
2011-07-18 21:04 ` Sascha Hauer
2011-07-19 13:14 ` Franck JULLIEN
2011-07-20 6:51 ` Sascha Hauer
2011-07-20 7:14 ` Franck JULLIEN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox