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 v2] lib/tst_test.c: Fix tst_brk() handling
Date: Tue, 8 Apr 2025 15:09:41 +0200	[thread overview]
Message-ID: <20250408130941.GD225750@pevik> (raw)
In-Reply-To: <20250404143423.16268-1-chrubis@suse.cz>

Hi Cyril,

> This makes the tst_brk() handling cleaner and saner as instead of
> propagating the tst_brk() result in a return value an abort flag is
> introduced into the shared memory.

LGTM. Thanks for updating the old API.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
...
>  /**
> - * tst_brk() - Reports a breakage and exits the test.
> + * tst_brk() - Reports a breakage and exits the test or test process.
>   *
>   * @ttype: An enum tst_res_type.
>   * @arg_fmt: A printf-like format.
>   * @...: A printf-like parameters.
>   *
> - * Reports either TBROK or TCONF and exits the test immediately. When called
> - * all children in the same process group as the main test library process are
> - * killed. This function, unless in a test cleanup, calls _exit() and does not
> - * return.
> + * Reports a single result and exits immediately. The call behaves differently
> + * based on the ttype parameter. For all ttype results but TBROK the call exits
> + * the current test process, i.e. increments test result counters and calls
> + * exit(0).
> + *
> + * The TBROK ttype is special that apart from exiting the current test process
> + * it also tells to the test library to exit immediately. When TBROK is
> + * triggered by any of the test processes the whole process group is killed so
> + * that there are no processes left after the library process exits. This also
> + * means that any subsequent test iterations are not executed, e.g. if a test
> + * runs for all filesystems and tst_brk() with TBROK is called, the test exits
> + * and does not attempt to continue a test iteration for the next filesystem.
>   *
>   * When test is in cleanup() function TBROK is converted into TWARN by the test
>   * library and we attempt to carry on with a cleanup even when tst_brk() was
>   * called. This makes it possible to use SAFE_FOO() macros in the test cleanup
>   * without interrupting the cleanup process on a failure.
>   */
> -#define tst_brk(ttype, arg_fmt, ...)						\
> -	({									\
> -		TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(!((ttype) &			\
> -			(TBROK | TCONF | TFAIL)));				\
> -		tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
> -	})

Could you please also before merge delete TST_BRK_SUPPORTS_ONLY_TCONF_TBROK()
definition in include/tst_common.h?

Kind regards,
Petr

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

  parent reply	other threads:[~2025-04-08 13:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-04 14:34 [LTP] [PATCH v2] lib/tst_test.c: Fix tst_brk() handling Cyril Hrubis
2025-04-04 15:47 ` Andrea Cervesato via ltp
2025-04-08 10:07 ` Jan Stancek via ltp
2025-04-08 13:09 ` Petr Vorel [this message]
2025-05-07 14:59 ` Cyril Hrubis

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=20250408130941.GD225750@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