[LTP] [PATCH v7 1/1] mmapstress01: refactor to tst_test framework

Petr Vorel pvorel@suse.cz
Fri Nov 11 17:53:53 CET 2022


Hi Edward, Richard, all,

> Hello,

> Richard Palethorpe <rpalethorpe@suse.de> writes:

> > Hello,

> > Edward Liaw via ltp <ltp@lists.linux.it> writes:

> >> Use ltp framework and apply make check corrections.  Reorder functions
> >> and variables.  Use safe macros.
> >> Drop leavefile option.
> >> Build tests with FILE_OFFSET_BITS=64 instead of doing LARGE_FILE checks
> >> to switch between 32 and 64 bit types and syscalls.
> >> Define fsize bounds by file offset bits.
> >> Move sighandler to setup and remove sig blocks.
> >> Add option to specify pattern.
> >> Set default nprocs to ncpus with min of 1 and max of 20.

> >> Signed-off-by: Edward Liaw <edliaw@google.com>

> > Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>

> > Will merge this today if the CI is happy and nobody comments.

> Merged, thanks!

Thanks for your work! FYI 2 tiny problems sneaked in, see below.

runtest/mm contained -t 0.20 option, which caused failure. Fixed in:
https://github.com/linux-test-project/ltp/commit/36321277a294c0467219f650fd76aa1a8d310c1d

> >> ---
> >>  testcases/kernel/mem/mmapstress/Makefile      |   2 +
...
> >> +static struct tst_option options[] = {
> >> +	{"d", &debug, "Enable debug output"},
> >> +	{"f:", &opt_filesize, "Initial filesize (default 4096)"},
> >> +	{"m", &do_sync, "Do random msync/fsyncs as well"},
> >> +	{"o", &do_offset, "Randomize the offset of file to map"},
> >> +	{"p:", &opt_nprocs,
> >> +	 "Number of mapping children to create (default 1 < ncpus < 20)"},
> >> +	{"P:", &opt_pattern,
> >> +	 "Use a fixed pattern (default random)"},
> >> +	{"r", &randloops,
> >> +	 "Randomize number of pages map children check (random % 500), "
> >> +	 "otherwise each child checks 500 pages"},
> >> +	{"S:", &opt_sparseoffset,
> >> +	 "When non-zero, causes the sparse area to be left before the data, "
> >> +	 "so that the actual initial filesize is sparseoffset + filesize "
> >> +	 "(default 0)"},
> >> +	{},
> >> +};
Using options as non-inline leads to our docparse documentation
having the name of the variable (options) i this case instead of listing
options.  Fixed in
https://github.com/linux-test-project/ltp/commit/72de038ff54496c5ced6ddc2d76713376aababb1

@Metan: I wonder if this can be fixed in docparser.
@Richie: If not, it would be nice to have check for it (I'll add issue with
"check" label).

@Edward FYI to build doc:
cd metadata && make # open ../docparse/metadata.html

Here is stable version:
http://linux-test-project.github.io/metadata/metadata.stable.html

I plan to write hook to put version for master branch, being updated after each
commit.

Kind regards,
Petr


More information about the ltp mailing list