From: sashiko-bot@kernel.org
To: "Jeff Barnes" <jeffbarnes@linux.microsoft.com>
Cc: linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] selftests/user_events: Test registration from existing threads
Date: Sat, 03 Oct 2026 01:33:12 +0000 [thread overview]
Message-ID: <20261003013313.26C221F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261002153934.798176-2-jeffbarnes@linux.microsoft.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] selftests: dead code due to ASSERT_EQ abort semantics
--
commit 9691dbbeea14ab3039a7e9d6bdc6fcfa2fc670a9
Author: Jeff Barnes <jeffbarnes@linux.microsoft.com>
selftests/user_events: Test registration from existing threads
This commit adds a test to verify user event registration from existing
threads. It creates two threads that attempt to register events using the
same enable address and bit. The test checks that the second registration
fails with EADDRINUSE because they share the same address space.
> diff --git a/tools/testing/selftests/user_events/abi_test.c b/tools/testing/selftests/user_events/abi_test.c
> index b71813eaf5c04..bb1a17ce00da0 100644
> --- a/tools/testing/selftests/user_events/abi_test.c
> +++ b/tools/testing/selftests/user_events/abi_test.c
[ ... ]
> @@ -258,6 +259,137 @@ FIXTURE_TEARDOWN(user) {
[ ... ]
> +TEST_F(user, preexisting_threads_same_address) {
[ ... ]
> + ASSERT_EQ(-1, registration.second_ret);
> + ASSERT_EQ(EADDRINUSE, registration.second_errno);
> +
> + if (!registration.second_ret)
> + ASSERT_EQ(0, registration.second_unreg_ret);
> +}
[Severity: Low]
Are the conditional and its assertion here reachable?
The kselftest framework's ASSERT_EQ() aborts the test via __bail() if the
values do not match. The preceding ASSERT_EQ(-1, registration.second_ret)
means that execution only continues if registration.second_ret is -1.
If registration.second_ret is -1, then !registration.second_ret will
always evaluate to false, skipping the second assertion.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261002153934.798176-1-jeffbarnes@linux.microsoft.com?part=1
next prev parent reply other threads:[~2026-10-03 1:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 15:39 [PATCH 0/2] tracing/user_events: Share state between existing threads Jeff Barnes
2026-10-02 15:39 ` [PATCH 1/2] selftests/user_events: Test registration from " Jeff Barnes
2026-10-03 1:33 ` sashiko-bot [this message]
2026-10-02 15:39 ` [PATCH 2/2] tracing/user_events: Share tracing state between " Jeff Barnes
2026-10-05 14:39 ` [PATCH v2 0/2] " Jeff Barnes
2026-10-05 14:39 ` [PATCH v2 1/2] selftests/user_events: Test registration from " Jeff Barnes
2026-10-05 14:39 ` [PATCH v2 2/2] tracing/user_events: Share tracing state between " Jeff Barnes
2026-10-06 16:47 ` [PATCH v2 0/3] tracing/user_events: Share state with " Jeff Barnes
2026-10-06 16:47 ` [PATCH v2 1/3] tracing/user_events: Serialize duplicate enabler lookup with event removal Jeff Barnes
2026-10-06 16:47 ` [PATCH v2 2/3] tracing/user_events: Share event state with existing threads Jeff Barnes
2026-10-06 16:47 ` [PATCH v2 3/3] selftests/user_events: Test registration from " Jeff Barnes
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=20261003013313.26C221F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jeffbarnes@linux.microsoft.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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