Skip to contentSkip to conversation

lib: Print version and kernel early enough

PATCH In review Petr Vorel 3 participants 4 messages Sep 30 – Oct 1 Library code

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 lib: Print version and kernel early enough

Print LTP version and tested kernel before calling do_setup() which can quit testing due various reasons, e.g.:

    # ./fw_load02
    tst_kconfig.c:90: TINFO: Parsing kernel config '/proc/config.gz'
    tst_kconfig.c:90: TINFO: Parsing kernel config '/proc/config.gz'
    tst_kconfig.c:90: TINFO: Parsing kernel config '/proc/config.gz'
    tst_security.c:115: TINFO: SecureBoot sysfs file not available
    tst_security.c:94: TINFO: Unable to determine system lockdown state
    tst_security.c:115: TINFO: SecureBoot sysfs file not available
    tst_tmpdir.c:309: TINFO: Using /tmp/LTP_fw_ZRzLML as tmpdir (btrfs filesystem)
    tst_sys_conf.c:103: TBROK: Failed to read anything from
	'/sys/module/firmware_class/parameters/path': SUCCESS (0)

It's always good to know this info.

Fixes eb0a5367fa ("lib: Print tested kernel and arch")
Fixes 546beb5340 ("lib/C-API: Print LTP version at test start")

---
It should be merged *after* the release.

 lib/tst_test.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
lib/tst_test.c +5 -5
index e27a24c246..10ff733971 100644
@@ -2058,17 +2058,17 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self)
 
 	tst_test = self;
 
+	tst_res(TINFO, "LTP version: "LTP_VERSION);
+
+	uname(&uval);
+	tst_res(TINFO, "Tested kernel: %s %s %s", uval.release, uval.version, uval.machine);
+
 	do_setup(argc, argv);
 	tst_enable_oom_protection(context->lib_pid);
 
 	SAFE_SIGNAL(SIGALRM, alarm_handler);
 	SAFE_SIGNAL(SIGUSR1, heartbeat_handler);
 
-	tst_res(TINFO, "LTP version: "LTP_VERSION);
-
-	uname(&uval);
-	tst_res(TINFO, "Tested kernel: %s %s %s", uval.release, uval.version, uval.machine);
-
 	if (tst_test->min_runtime && !tst_test->runtime)
 		tst_test->runtime = tst_test->min_runtime;
 
Signature · 5 lines
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Petr,

lib/tst_test.c void tst_run_tcases(int argc, char *argv[], struct tst_test *self) · line 2066

Quoted 8 lines · Petr Vorel

lib: Print version and kernel early enough

lib/tst_test.c +5 -0
+	tst_res(TINFO, "LTP version: "LTP_VERSION);
+
+	uname(&uval);
+	tst_res(TINFO, "Tested kernel: %s %s %s", uval.release, uval.version, uval.machine);
+
 	do_setup(argc, argv);

LTP_REPRODUCIBLE_OUTPUT=1 or y no longer suppresses these TINFO messages:
test05 prints both, whereas master prints neither. The flag is initialized inside do_setup(), so these calls bypass suppression and introduce kernel/build-dependent output. Move the environment-based initialization before these messages.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

Hi Cyril,

thanks, merged!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp