From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Song Hu <husong@kylinos.cn>,
akpm@linux-foundation.org, rppt@kernel.org, leitao@debian.org
Cc: usama.anjum@arm.com, linux-mm@kvack.org, shuah@kernel.org,
david@kernel.org, ljs@kernel.org, liam@infradead.org,
vbabka@kernel.org, surenb@google.com, mhocko@suse.com,
peterx@redhat.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] selftests/mm: emit KTAP output from ksft_kmemleak_dedup
Date: Mon, 17 Aug 2026 11:23:01 +0100 [thread overview]
Message-ID: <2adba3ff-e548-470a-a41e-05954733f62c@arm.com> (raw)
In-Reply-To: <20260815084231.3630742-1-husong@kylinos.cn>
On 15/08/2026 9:42 am, Song Hu wrote:
> ksft_kmemleak_dedup.sh reports its result with raw "SKIP:"/"FAIL:"/"PASS:"
> echoes and bare exit codes instead of KTAP, so parse_kselftest.py cannot
> read it. Convert it to the ktap_helpers.sh API, like its sibling
> ksft_kmemleak_confirm.sh.
>
> skip() and fail() emit ktap_test_skip()/ktap_test_fail() instead of
> ktap_skip_all()/ktap_exit_fail_msg(), and a single ktap_set_plan() at the
> top covers every path; ktap_finished() then prints the totals line and
> provides the exit code for skip/fail/pass alike.
>
> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> Reviewed-by: Breno Leitao <leitao@debian.org>
> Signed-off-by: Song Hu <husong@kylinos.cn>
> ---
>
> Changes in v2, per review feedback from Usama Anjum:
> - use ktap_test_skip() instead of ktap_skip_all(), and ktap_test_fail()
> instead of ktap_exit_fail_msg()
> - move ktap_set_plan() to the very start so it covers all paths
> - call ktap_finished() on the skip and fail paths as well
Thank you for updating the patch.
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Reviewed-by: Muhammad Usma Anjum <usama.anjum@arm.com>
>
> v1: https://lore.kernel.org/all/20260812132142.582390-1-husong@kylinos.cn/
> .../selftests/mm/ksft_kmemleak_dedup.sh | 21 ++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/ksft_kmemleak_dedup.sh b/tools/testing/selftests/mm/ksft_kmemleak_dedup.sh
> index d01950244490..fda6a9340e0e 100755
> --- a/tools/testing/selftests/mm/ksft_kmemleak_dedup.sh
> +++ b/tools/testing/selftests/mm/ksft_kmemleak_dedup.sh
> @@ -19,24 +19,31 @@
> #
> # Author: Breno Leitao <leitao@debian.org>
>
> -ksft_skip=4
> +# KTAP output helpers (ktap_test_pass, ktap_test_skip, ktap_test_fail, ...).
> +DIR="$(dirname "$(readlink -f "$0")")"
> +# shellcheck source=../kselftest/ktap_helpers.sh
> +source "${DIR}"/../kselftest/ktap_helpers.sh
> +
> KMEMLEAK=/sys/kernel/debug/kmemleak
> VERBOSE_PARAM=/sys/module/kmemleak/parameters/verbose
> MODULE=kmemleak-test
>
> +ktap_print_header
> +ktap_set_plan 1
> +
> skip() {
> - echo "SKIP: $*"
> - exit $ksft_skip
> + ktap_test_skip "$*"
> + ktap_finished
> }
>
> fail() {
> - echo "FAIL: $*"
> - exit 1
> + ktap_test_fail "$*"
> + ktap_finished
> }
>
> pass() {
> - echo "PASS: $*"
> - exit 0
> + ktap_test_pass "$*"
> + ktap_finished
> }
>
> [ "$(id -u)" -eq 0 ] || skip "must run as root"
--
Thanks,
Usama
next prev parent reply other threads:[~2026-08-17 10:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-15 8:42 [PATCH v2] selftests/mm: emit KTAP output from ksft_kmemleak_dedup Song Hu
2026-08-17 9:38 ` David Hildenbrand (Arm)
2026-08-17 10:23 ` Muhammad Usama Anjum [this message]
2026-08-17 11:24 ` Lorenzo Stoakes (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=2adba3ff-e548-470a-a41e-05954733f62c@arm.com \
--to=usama.anjum@arm.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=husong@kylinos.cn \
--cc=leitao@debian.org \
--cc=liam@infradead.org \
--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=peterx@redhat.com \
--cc=rppt@kernel.org \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.