Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Hongfu Li <lihongfu@kylinos.cn>,
	akpm@linux-foundation.org, ljs@kernel.org, liam@infradead.org,
	vbabka@kernel.org, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com, shuah@kernel.org
Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, jhubbard@nvidia.com,
	joey.gouly@arm.com, keith.lucas@oracle.com,
	kevin.brodsky@arm.com, usama.anjum@collabora.com,
	yury.khrustalev@arm.com, zwisler@google.com, hongfu.li@linux.dev
Subject: Re: [PATCH v9 1/5] selftests/mm: move pkey selftest helpers to pkey_util.c
Date: Mon, 6 Jul 2026 11:28:38 +0200	[thread overview]
Message-ID: <436863f8-5840-4c3f-82ec-c55b46fb9969@kernel.org> (raw)
In-Reply-To: <20260702062332.911786-2-lihongfu@kylinos.cn>

On 7/2/26 08:23, Hongfu Li wrote:
> Move pkey selftest debugging helpers into shared code so both pkey
> selftests can use the same tracing and abort-hook logic. Also fix
> cat_into_file() to print file, not str, in the open() failure message.
> 
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> Acked-by: Liam R. Howlett (Oracle) <liam@infradead.org>
> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
> Tested-by: Kevin Brodsky <kevin.brodsky@arm.com>
> ---
>  tools/testing/selftests/mm/pkey-helpers.h    |  4 +-
>  tools/testing/selftests/mm/pkey_util.c       | 90 ++++++++++++++++++++
>  tools/testing/selftests/mm/protection_keys.c | 87 -------------------
>  3 files changed, 93 insertions(+), 88 deletions(-)
> 
> diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h
> index 2c377f4e9df1..46a8a1878dc1 100644
> --- a/tools/testing/selftests/mm/pkey-helpers.h
> +++ b/tools/testing/selftests/mm/pkey-helpers.h
> @@ -68,7 +68,9 @@ static inline void sigsafe_printf(const char *format, ...)
>  #define dprintf3(args...) dprintf_level(3, args)
>  #define dprintf4(args...) dprintf_level(4, args)
>  
> -extern void abort_hooks(void);
> +void tracing_on(void);
> +void tracing_off(void);
> +void abort_hooks(void);
>  #define pkey_assert(condition) do {		\
>  	if (!(condition)) {			\
>  		dprintf0("# assert() at %s::%d test_nr: %d iteration: %d\n", \
> diff --git a/tools/testing/selftests/mm/pkey_util.c b/tools/testing/selftests/mm/pkey_util.c
> index 255b332f7a08..fbef3cd45447 100644
> --- a/tools/testing/selftests/mm/pkey_util.c
> +++ b/tools/testing/selftests/mm/pkey_util.c
> @@ -2,9 +2,99 @@
>  #define __SANE_USERSPACE_TYPES__
>  #include <sys/syscall.h>
>  #include <unistd.h>
> +#include <fcntl.h>
> +#include <stdio.h>
> +#include <string.h>
>  
>  #include "pkey-helpers.h"
>  
> +int iteration_nr = 1;
> +int test_nr;
> +int dprint_in_signal;
> +
> +#if CONTROL_TRACING > 0

Who sets that CONTROL_TRACING? And if it's nobody, why are we dragging this along?

-- 
Cheers,

David


  parent reply	other threads:[~2026-07-06  9:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260702062332.911786-1-lihongfu@kylinos.cn>
2026-07-05 20:48 ` [PATCH v9 0/5] selftests/mm: refactor pkey helpers and fix mmap error handling Andrew Morton
2026-07-06  7:32   ` Hongfu Li
     [not found] ` <20260702062332.911786-2-lihongfu@kylinos.cn>
2026-07-06  9:28   ` David Hildenbrand (Arm) [this message]
2026-07-06 10:31     ` [PATCH v9 1/5] selftests/mm: move pkey selftest helpers to pkey_util.c Hongfu Li
2026-07-06 13:46       ` David Hildenbrand (Arm)

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=436863f8-5840-4c3f-82ec-c55b46fb9969@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hongfu.li@linux.dev \
    --cc=jhubbard@nvidia.com \
    --cc=joey.gouly@arm.com \
    --cc=keith.lucas@oracle.com \
    --cc=kevin.brodsky@arm.com \
    --cc=liam@infradead.org \
    --cc=lihongfu@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=usama.anjum@collabora.com \
    --cc=vbabka@kernel.org \
    --cc=yury.khrustalev@arm.com \
    --cc=zwisler@google.com \
    /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