summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-15 21:39:14 -0600
committerBin Meng <bmeng@tinylab.org>2023-07-17 17:23:15 +0800
commitf9ebfd7c7acebd3d28a3be1d33e30c6f88a05302 (patch)
tree3ae6b9f357f8a5e88b38a8327b3772463e74a7df /common
parentdac1fa5c197ae30a60b2ce7489051359b9c8ebea (diff)
downloadu-boot-f9ebfd7c7acebd3d28a3be1d33e30c6f88a05302.tar.gz
u-boot-f9ebfd7c7acebd3d28a3be1d33e30c6f88a05302.tar.bz2
u-boot-f9ebfd7c7acebd3d28a3be1d33e30c6f88a05302.zip
log: Support outputing function names in SPL
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>
Diffstat (limited to 'common')
-rw-r--r--common/log_console.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/log_console.c b/common/log_console.c
index f1dcc04b97..bb091ce21a 100644
--- a/common/log_console.c
+++ b/common/log_console.c
@@ -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);