[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fcf40deb-e731-c257-fb77-7fcfddf623b1@redhat.com>
Date: Mon, 3 Apr 2023 09:59:50 +0200
From: David Hildenbrand <david@...hat.com>
To: Peter Xu <peterx@...hat.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: Andrea Arcangeli <aarcange@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Nadav Amit <nadav.amit@...il.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Leonardo Bras Soares Passos <lsoaresp@...hat.com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>
Subject: Re: [PATCH 16/29] selftests/mm: UFFDIO_API test
On 30.03.23 18:07, Peter Xu wrote:
> Add one simple test for UFFDIO_API. With that, I also added a bunch of
> small but handy helpers along the way.
>
> Signed-off-by: Peter Xu <peterx@...hat.com>
> ---
> tools/testing/selftests/mm/uffd-unit-tests.c | 111 ++++++++++++++++++-
> tools/testing/selftests/mm/vm_util.c | 10 ++
> 2 files changed, 120 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c
> index 6857388783be..dfb44ffad5f5 100644
> --- a/tools/testing/selftests/mm/uffd-unit-tests.c
> +++ b/tools/testing/selftests/mm/uffd-unit-tests.c
> @@ -9,9 +9,118 @@
>
> #ifdef __NR_userfaultfd
>
> +struct {
> + unsigned int pass, skip, fail, total;
> +} uffd_test_acct;
> +
> +static void uffd_test_report(void)
> +{
> + printf("Userfaults unit tests: pass=%u, skip=%u, fail=%u (total=%u)\n",
> + uffd_test_acct.pass,
> + uffd_test_acct.skip,
> + uffd_test_acct.fail,
> + uffd_test_acct.total);
> +}
> +
> +static void uffd_test_pass(void)
> +{
> + printf("done\n");
> + uffd_test_acct.pass++;
> +}
> +
> +#define uffd_test_start(...) do { \
> + printf(__VA_ARGS__); \
> + printf("... "); \
> + uffd_test_acct.total++; \
> + } while (0)
> +
> +#define uffd_test_fail(...) do { \
> + printf("failed [reason: "); \
> + printf(__VA_ARGS__); \
> + printf("]\n"); \
> + uffd_test_acct.fail++; \
> + } while (0)
> +
> +#define uffd_test_skip(...) do { \
> + printf("skipped [reason: "); \
> + printf(__VA_ARGS__); \
> + printf("]\n"); \
> + uffd_test_acct.skip++; \
> + } while (0)
> +
There is ksft_print_msg, ksft_test_result, ksft_test_result_fail, ... do
we maybe want to convert properly to ksft while already at it?
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists