Re: [PATCH v3 5/6] selftests: futex2: Add waitv test

From: Gabriel Krisman Bertazi
Date: Mon Sep 13 2021 - 21:11:11 EST


André Almeida <andrealmeid@xxxxxxxxxxxxx> writes:

> Create a new file to test the waitv mechanism. Test both private and
> shared futexes. Wake the last futex in the array, and check if the
> return value from futex_waitv() is the right index.
>
> Signed-off-by: André Almeida <andrealmeid@xxxxxxxxxxxxx>
> ---
> .../selftests/futex/functional/.gitignore | 1 +
> .../selftests/futex/functional/Makefile | 3 +-
> .../selftests/futex/functional/futex_waitv.c | 158 ++++++++++++++++++
> .../testing/selftests/futex/functional/run.sh | 3 +
> .../selftests/futex/include/futex2test.h | 31 ++++
> 5 files changed, 195 insertions(+), 1 deletion(-)
> create mode 100644 tools/testing/selftests/futex/functional/futex_waitv.c
> create mode 100644 tools/testing/selftests/futex/include/futex2test.h
>
> diff --git a/tools/testing/selftests/futex/functional/.gitignore b/tools/testing/selftests/futex/functional/.gitignore
> index 0e78b49d0f2f..fbcbdb6963b3 100644
> --- a/tools/testing/selftests/futex/functional/.gitignore
> +++ b/tools/testing/selftests/futex/functional/.gitignore
> @@ -8,3 +8,4 @@ futex_wait_uninitialized_heap
> futex_wait_wouldblock
> futex_wait
> futex_requeue
> +futex_waitv
> diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
> index bd1fec59e010..5cc38de9d8ea 100644
> --- a/tools/testing/selftests/futex/functional/Makefile
> +++ b/tools/testing/selftests/futex/functional/Makefile
> @@ -17,7 +17,8 @@ TEST_GEN_FILES := \
> futex_wait_uninitialized_heap \
> futex_wait_private_mapped_file \
> futex_wait \
> - futex_requeue
> + futex_requeue \
> + futex_waitv
>
> TEST_PROGS := run.sh
>
> diff --git a/tools/testing/selftests/futex/functional/futex_waitv.c b/tools/testing/selftests/futex/functional/futex_waitv.c
> new file mode 100644
> index 000000000000..567667dfa7cf
> --- /dev/null
> +++ b/tools/testing/selftests/futex/functional/futex_waitv.c
> @@ -0,0 +1,158 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/******************************************************************************
> + *
> + * Copyright Collabora Ltd., 2021
> + *
> + * DESCRIPTION
> + * Test waitv/wake mechanism of futex2, using 32bit sized futexes.
> + *
> + * AUTHOR
> + * André Almeida <andrealmeid@xxxxxxxxxxxxx>
> + *
> + * HISTORY
> + * 2021-Feb-5: Initial version by André <andrealmeid@xxxxxxxxxxxxx>

We have git to keep history nowadays. This type of changelog is a relic
from less civilized times and adds no extra information. :)



--
Gabriel Krisman Bertazi