[LTP] [PATCH 1/1] tst_test.h: Convert rest of doc to kerneldoc

Petr Vorel pvorel@suse.cz
Tue Apr 21 16:32:00 CEST 2026


Hi Cyril,

...
> > +/**
> > + * tst_set_runtime() - Sets maximal test runtime in seconds.
> > + *
> > + * Allows for setting the runtime per test iteration dynamically during the test
> > + * setup phase. The runtime is specified in seconds and defines how long the
> > + * test is allowed to execute its main workload, excluding the setup and
> > + * teardown phases.
> > + *
> > + * This function is useful for tests where the duration of the main workload can
> > + * be controlled or needs to be adjusted dynamically. For example, tests that
> > + * run in a loop until the runtime expires can use this function to define how
> > + * long they should execute.

> Maybe add:

> A test that sets a runtime must monitor the remaining time with
> tst_remaining_runtime() in the main loop.

I understand it as: "tests which calls tst_set_runtime() needs also use
tst_remaining_runtime() for monitoring. FYI while some tests do that (e.g.
starvation.c, fsplough.c), some don't (e.g. semget05.c, readahead02.c,
crash02.c). Obviously they are not interrupted in the middle of action, but
maybe check them once you have time.

Also it might be worth if you check the description of the timeout and runtime
members of struct tst_test
https://linux-test-project.readthedocs.io/en/latest/developers/api_c_tests.html#tst-test-members

Going to finally send v2.

Kind regards,
Petr

> > + * @runtime: A timeout in seconds.
> >   */
> >  void tst_set_runtime(int runtime);


More information about the ltp mailing list