]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
log: Support outputing function names in SPL
authorSimon Glass <sjg@chromium.org>
Sun, 16 Jul 2023 03:39:14 +0000 (21:39 -0600)
committerBin Meng <bmeng@tinylab.org>
Mon, 17 Jul 2023 09:23:15 +0000 (17:23 +0800)
The output is garbled when tiny printf() is used. Correct this by adding
a special case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
common/log_console.c

index f1dcc04b97c915668613ee15959dae53247d8d15..bb091ce21a4a616e763406b4f4c8e1a61acd0932 100644 (file)
@@ -37,8 +37,14 @@ static int log_console_emit(struct log_device *ldev, struct log_rec *rec)
                        printf("%s:", rec->file);
                if (fmt & BIT(LOGF_LINE))
                        printf("%d-", rec->line);
-               if (fmt & BIT(LOGF_FUNC))
-                       printf("%*s()", CONFIG_LOGF_FUNC_PAD, rec->func);
+               if (fmt & BIT(LOGF_FUNC)) {
+                       if (CONFIG_IS_ENABLED(USE_TINY_PRINTF)) {
+                               printf("%s()", rec->func);
+                       } else {
+                               printf("%*s()", CONFIG_LOGF_FUNC_PAD,
+                                      rec->func);
+                       }
+               }
        }
        if (fmt & BIT(LOGF_MSG))
                printf("%s%s", add_space ? " " : "", rec->msg);