diff mbox series

[v5,3/6] log: output for CONFIG_LOG=n

Message ID 20200226204820.17376-4-xypron.glpk@gmx.de
State Accepted
Commit 20fd256deb055479c9c0c9f0b1a9f9098c96f310
Headers show
Series log: syslog logging driver | expand

Commit Message

Heinrich Schuchardt Feb. 26, 2020, 8:48 p.m. UTC
If CONFIG_LOG=n, we should still output errors, warnings, notices, infos,
and for DEBUG=1 also debug messages.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
v5:
	no change
v4:
	no change
---
 include/log.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--
2.25.0

Comments

Simon Glass March 3, 2020, 2:46 a.m. UTC | #1
If CONFIG_LOG=n, we should still output errors, warnings, notices, infos,
and for DEBUG=1 also debug messages.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
v5:
	no change
v4:
	no change
---
 include/log.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Applied to u-boot-dm, thanks!
Marek Vasut April 22, 2020, 7 p.m. UTC | #2
On 2/26/20 9:48 PM, Heinrich Schuchardt wrote:
> If CONFIG_LOG=n, we should still output errors, warnings, notices, infos,
> and for DEBUG=1 also debug messages.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Reviewed-by: Simon Glass <sjg at chromium.org>

NAK

This patch grows SoCFPGA SPL size by more than 6 bytes, and considering
the recent discussion, I believe it was made very clear that any growth
in SPL size is not allowed. I am surprised that this was not caught earlier.

So, please revert this patch.

I see the following with socfpga_cyclone5_defconfig

   text    data     bss     dec     hex filename
- 52235    1916      16   54167    d397 spl/u-boot-spl
+ 52319    1916      16   54251    d3eb spl/u-boot-spl

> ---
> v5:
> 	no change
> v4:
> 	no change
> ---
>  include/log.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/log.h b/include/log.h
> index 62fb8afbd0..0453876001 100644
> --- a/include/log.h
> +++ b/include/log.h
> @@ -115,11 +115,11 @@ static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
>  #define log_io(_fmt...)		log(LOG_CATEGORY, LOGL_DEBUG_IO, ##_fmt)
>  #else
>  #define _LOG_MAX_LEVEL LOGL_INFO
> -#define log_err(_fmt...)	log_nop(LOG_CATEGORY, LOGL_ERR, ##_fmt)
> -#define log_warning(_fmt...)	log_nop(LOG_CATEGORY, LOGL_WARNING, ##_fmt)
> -#define log_notice(_fmt...)	log_nop(LOG_CATEGORY, LOGL_NOTICE, ##_fmt)
> -#define log_info(_fmt...)	log_nop(LOG_CATEGORY, LOGL_INFO, ##_fmt)
> -#define log_debug(_fmt...)	log_nop(LOG_CATEGORY, LOGL_DEBUG, ##_fmt)
> +#define log_err(_fmt, ...)	printf(_fmt, ##__VA_ARGS__)
> +#define log_warning(_fmt, ...)	printf(_fmt, ##__VA_ARGS__)
> +#define log_notice(_fmt, ...)	printf(_fmt, ##__VA_ARGS__)
> +#define log_info(_fmt, ...)	printf(_fmt, ##__VA_ARGS__)
> +#define log_debug(_fmt, ...)	debug(_fmt, ##__VA_ARGS__)
>  #define log_content(_fmt...)	log_nop(LOG_CATEGORY, \
>  					LOGL_DEBUG_CONTENT, ##_fmt)
>  #define log_io(_fmt...)		log_nop(LOG_CATEGORY, LOGL_DEBUG_IO, ##_fmt)
> --
> 2.25.0
>
Tom Rini April 22, 2020, 7:01 p.m. UTC | #3
On Wed, Apr 22, 2020 at 09:00:02PM +0200, Marek Vasut wrote:
> On 2/26/20 9:48 PM, Heinrich Schuchardt wrote:
> > If CONFIG_LOG=n, we should still output errors, warnings, notices, infos,
> > and for DEBUG=1 also debug messages.
> > 
> > Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> > Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> NAK
> 
> This patch grows SoCFPGA SPL size by more than 6 bytes, and considering
> the recent discussion, I believe it was made very clear that any growth
> in SPL size is not allowed. I am surprised that this was not caught earlier.
> 
> So, please revert this patch.
> 
> I see the following with socfpga_cyclone5_defconfig
> 
>    text    data     bss     dec     hex filename
> - 52235    1916      16   54167    d397 spl/u-boot-spl
> + 52319    1916      16   54251    d3eb spl/u-boot-spl

Bugfix of previously important prints being missing.  Fix your patch and
quit trolling please.
Marek Vasut April 22, 2020, 7:10 p.m. UTC | #4
On 4/22/20 9:01 PM, Tom Rini wrote:
> On Wed, Apr 22, 2020 at 09:00:02PM +0200, Marek Vasut wrote:
>> On 2/26/20 9:48 PM, Heinrich Schuchardt wrote:
>>> If CONFIG_LOG=n, we should still output errors, warnings, notices, infos,
>>> and for DEBUG=1 also debug messages.
>>>
>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>>> Reviewed-by: Simon Glass <sjg at chromium.org>
>>
>> NAK
>>
>> This patch grows SoCFPGA SPL size by more than 6 bytes, and considering
>> the recent discussion, I believe it was made very clear that any growth
>> in SPL size is not allowed. I am surprised that this was not caught earlier.
>>
>> So, please revert this patch.
>>
>> I see the following with socfpga_cyclone5_defconfig
>>
>>    text    data     bss     dec     hex filename
>> - 52235    1916      16   54167    d397 spl/u-boot-spl
>> + 52319    1916      16   54251    d3eb spl/u-boot-spl
> 
> Bugfix of previously important prints being missing.
So, can you please clarify what the rule for acceptable SPL growth is?
diff mbox series

Patch

diff --git a/include/log.h b/include/log.h
index 62fb8afbd0..0453876001 100644
--- a/include/log.h
+++ b/include/log.h
@@ -115,11 +115,11 @@  static inline int _log_nop(enum log_category_t cat, enum log_level_t level,
 #define log_io(_fmt...)		log(LOG_CATEGORY, LOGL_DEBUG_IO, ##_fmt)
 #else
 #define _LOG_MAX_LEVEL LOGL_INFO
-#define log_err(_fmt...)	log_nop(LOG_CATEGORY, LOGL_ERR, ##_fmt)
-#define log_warning(_fmt...)	log_nop(LOG_CATEGORY, LOGL_WARNING, ##_fmt)
-#define log_notice(_fmt...)	log_nop(LOG_CATEGORY, LOGL_NOTICE, ##_fmt)
-#define log_info(_fmt...)	log_nop(LOG_CATEGORY, LOGL_INFO, ##_fmt)
-#define log_debug(_fmt...)	log_nop(LOG_CATEGORY, LOGL_DEBUG, ##_fmt)
+#define log_err(_fmt, ...)	printf(_fmt, ##__VA_ARGS__)
+#define log_warning(_fmt, ...)	printf(_fmt, ##__VA_ARGS__)
+#define log_notice(_fmt, ...)	printf(_fmt, ##__VA_ARGS__)
+#define log_info(_fmt, ...)	printf(_fmt, ##__VA_ARGS__)
+#define log_debug(_fmt, ...)	debug(_fmt, ##__VA_ARGS__)
 #define log_content(_fmt...)	log_nop(LOG_CATEGORY, \
 					LOGL_DEBUG_CONTENT, ##_fmt)
 #define log_io(_fmt...)		log_nop(LOG_CATEGORY, LOGL_DEBUG_IO, ##_fmt)