[U-Boot] [PATCH 0/3] efi_selftest: beautify test output

Remove some superfluous messages if no error occurs. Do not cut off device paths in test output.
Heinrich Schuchardt (3): efi_selftest: avoid superfluous messages for event services efi_selftest: avoid superfluous messages for task priority levels efi_selftest: do not cut off u16 strings when printing
lib/efi_selftest/efi_selftest_console.c | 16 ++++++++++------ lib/efi_selftest/efi_selftest_events.c | 8 +++++--- lib/efi_selftest/efi_selftest_tpl.c | 15 +++++++++------ 3 files changed, 24 insertions(+), 15 deletions(-)

In the event services test debug output is written even if no failure is detected.
Remove this distracting output.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- lib/efi_selftest/efi_selftest_events.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/efi_selftest/efi_selftest_events.c b/lib/efi_selftest/efi_selftest_events.c index ad9490bd25..5393e39352 100644 --- a/lib/efi_selftest/efi_selftest_events.c +++ b/lib/efi_selftest/efi_selftest_events.c @@ -142,8 +142,8 @@ static int execute(void) efi_st_error("WaitForEvent returned wrong index\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count periodic: %u\n", timer_ticks); if (timer_ticks < 8 || timer_ticks > 12) { + efi_st_printf("Notification count periodic: %u\n", timer_ticks); efi_st_error("Incorrect timing of events\n"); return EFI_ST_FAILURE; } @@ -170,8 +170,9 @@ static int execute(void) efi_st_error("Could not wait for event\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count single shot: %u\n", timer_ticks); if (timer_ticks != 1) { + efi_st_printf("Notification count single shot: %u\n", + timer_ticks); efi_st_error("Single shot timer failed\n"); return EFI_ST_FAILURE; } @@ -180,8 +181,9 @@ static int execute(void) efi_st_error("Could not wait for event\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count stopped timer: %u\n", timer_ticks); if (timer_ticks != 1) { + efi_st_printf("Notification count stopped timer: %u\n", + timer_ticks); efi_st_error("Stopped timer fired\n"); return EFI_ST_FAILURE; }

In the task priority levels test debug output is written even if no failure is detected.
Remove this distracting output.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- lib/efi_selftest/efi_selftest_tpl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lib/efi_selftest/efi_selftest_tpl.c b/lib/efi_selftest/efi_selftest_tpl.c index 6ea0bb7177..8243fae15b 100644 --- a/lib/efi_selftest/efi_selftest_tpl.c +++ b/lib/efi_selftest/efi_selftest_tpl.c @@ -144,9 +144,10 @@ static int execute(void) efi_st_error("WaitForEvent returned wrong index\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count with TPL level TPL_APPLICATION: %u\n", - notification_count); if (notification_count < 8 || notification_count > 12) { + efi_st_printf( + "Notification count with TPL level TPL_APPLICATION: %u\n", + notification_count); efi_st_error("Incorrect timing of events\n"); return EFI_ST_FAILURE; } @@ -181,9 +182,10 @@ static int execute(void) efi_st_error("Could not check event\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count with TPL level TPL_CALLBACK: %u\n", - notification_count); if (notification_count != 0) { + efi_st_printf( + "Notification count with TPL level TPL_CALLBACK: %u\n", + notification_count); efi_st_error("Suppressed timer fired\n"); return EFI_ST_FAILURE; } @@ -200,9 +202,10 @@ static int execute(void) efi_st_error("Could not wait for event\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count with TPL level TPL_APPLICATION: %u\n", - notification_count); if (notification_count < 1) { + efi_st_printf( + "Notification count with TPL level TPL_APPLICATION: %u\n", + notification_count); efi_st_error("Queued timer event did not fire\n"); return EFI_ST_FAILURE; }

Device paths can be very long. Due to a limited output buffer the output for device paths is cut off. We can avoid this by directly calling the boottime service with the the device path string.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- lib/efi_selftest/efi_selftest_console.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/lib/efi_selftest/efi_selftest_console.c b/lib/efi_selftest/efi_selftest_console.c index 7920c961ba..d30bad17d6 100644 --- a/lib/efi_selftest/efi_selftest_console.c +++ b/lib/efi_selftest/efi_selftest_console.c @@ -143,10 +143,12 @@ void efi_st_printc(int color, const char *fmt, ...) const char *c; u16 *pos = buf; const char *s; - const u16 *u; + u16 *u;
va_start(args, fmt);
+ if (color >= 0) + con_out->set_attribute(con_out, (unsigned long)color); c = fmt; for (; *c; ++c) { switch (*c) { @@ -189,9 +191,13 @@ void efi_st_printc(int color, const char *fmt, ...) /* u16 string */ case 's': u = va_arg(args, u16*); - /* Ensure string fits into buffer */ - for (; *u && pos < buf + 120; ++u) - *pos++ = *u; + if (pos > buf) { + *pos = 0; + con_out->output_string(con_out, + buf); + } + con_out->output_string(con_out, u); + pos = buf; break; default: --c; @@ -216,8 +222,6 @@ void efi_st_printc(int color, const char *fmt, ...) } va_end(args); *pos = 0; - if (color >= 0) - con_out->set_attribute(con_out, (unsigned long)color); con_out->output_string(con_out, buf); if (color >= 0) con_out->set_attribute(con_out, EFI_LIGHTGRAY);
participants (1)
-
Heinrich Schuchardt