Skip to content

Commit

Permalink
mmapstress01: Inline struct tst_option to fix docparse output
Browse files Browse the repository at this point in the history
When using declared array the docs in .options contain just
the name of the variable (options in this case) instead listing
the options.

Fixes: 88321bf ("mmapstress01: refactor to tst_test framework")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
  • Loading branch information
pevik committed Nov 11, 2022
1 parent 3632127 commit 72de038
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions testcases/kernel/mem/mmapstress/mmapstress01.c
Expand Up @@ -71,25 +71,6 @@ static long long sparseoffset;
static size_t pagesize;
static int pattern;

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)"},
{},
};

static void setup(void)
{
struct sigaction sa;
Expand Down Expand Up @@ -362,7 +343,24 @@ static void run(void)
static struct tst_test test = {
.test_all = run,
.setup = setup,
.options = options,
.options = (struct tst_option[]) {
{"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)"},
{},
},
.cleanup = cleanup,
.max_runtime = 12,
.needs_tmpdir = 1,
Expand Down

0 comments on commit 72de038

Please sign in to comment.