[LTP] [PATCH] mlock05: add log details about the success/failure

Cyril Hrubis chrubis@suse.cz
Tue Jul 30 09:36:53 CEST 2024


Hi!
> Our test logs will be reviewed by people not familiar with the test purpose
> or its implementation. These will be people who may not have the background
> or time necessary to read and understand the source code.

You may be interested in the metadata extracted during the test build as
well. LTP produces a big a big html page with descriptions extracted
from the tests in docparse/metadata.html for mlock05 you get:

...

Description

Verify mlock() causes pre-faulting of PTEs and prevent memory to be swapped out.

Find the new mapping in /proc/$pid/smaps and check Rss and Locked fields
after mlock syscall: Rss and Locked size should be equal to the size of
the memory allocation

...

> However, improving the TST_EXP_EQ_LU() macro to print additional
> information looks great and I believe it would be the better approach, as
> it would also be useful for future contributions.
> Do you already have something in mind for a possible implementation?
> I was thinking of creating a new one that looks like this:
> TST_EXP_EQ_LU_MSG() so that the test writer can add a custom message where
> the test passes/fails.

Most of the TST_EXP_*() macros have optional printf-like format string
and parameters, it should be easy to add that functionality the
TST_EXP_EQ_*() macros as well.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list