public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] tst_test.h: Convert rest of doc to kerneldoc
Date: Tue, 21 Apr 2026 16:32:00 +0200	[thread overview]
Message-ID: <20260421143200.GA611911@pevik> (raw)
In-Reply-To: <acT03xEWLjfMjU9z@yuki.lan>

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);

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2026-04-21 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 12:06 [LTP] [PATCH 1/1] tst_test.h: Convert rest of doc to kerneldoc Petr Vorel
2026-03-26  8:57 ` Cyril Hrubis
2026-04-21 14:32   ` Petr Vorel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260421143200.GA611911@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox