From nobody Wed Dec 17 20:58:42 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBF11824AC for ; Fri, 3 May 2024 22:50:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714776634; cv=none; b=kmMfqNpWurRyjp2q95BKJwifko1qIYPjao1p3ZkzBfrfNgBEn3goiol15YuN5SOFPY099+iYEaQppic9N48yRdwFk+u9xMXunTqv0Er83xlbecd92J+6fDyEaqhmzAQoV6/fdxnpOnqH++XD9YmlayWafyoPBesEjWK6SgpYdyM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714776634; c=relaxed/simple; bh=VuXalIPTL9sTa7bnw/R/Fo8g3BmGZ0SIUARYlC9WdwQ=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=cMfoCv7aSXagqRvyY3dJ4ytpFL5kFE4Bm5VeskDMLQQ9HXpNQ7PfYShSRijxVyrQEGi13r0bpu0LcMbgTZFUuf4Gn3UA+wzal9rCBfGwgEg/e3glFjvfWNW29o+Ypya08Fb5EY5PONUg/aFDZ1leUCzS4i3Atg94k3AE1MU0KY8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E42DC4AF1B; Fri, 3 May 2024 22:50:34 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1s31jd-00000000NKd-3lK5; Fri, 03 May 2024 18:50:33 -0400 Message-ID: <20240503225033.758019899@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 03 May 2024 18:50:15 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Beau Belgrave Subject: [for-linus][PATCH 2/9] selftests/user_events: Add non-spacing separator check References: <20240503225013.519028385@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Beau Belgrave The ABI documentation indicates that field separators do not need a space between them, only a ';'. When no spacing is used, the register must work. Any subsequent register, with or without spaces, must match and not return -EADDRINUSE. Add a non-spacing separator case to our self-test register case to ensure it works going forward. Link: https://lore.kernel.org/linux-trace-kernel/20240423162338.292-3-beaub= @linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) --- tools/testing/selftests/user_events/ftrace_test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/user_events/ftrace_test.c b/tools/test= ing/selftests/user_events/ftrace_test.c index dcd7509fe2e0..0bb46793dcd4 100644 --- a/tools/testing/selftests/user_events/ftrace_test.c +++ b/tools/testing/selftests/user_events/ftrace_test.c @@ -261,6 +261,12 @@ TEST_F(user, register_events) { ASSERT_EQ(0, ioctl(self->data_fd, DIAG_IOCSREG, ®)); ASSERT_EQ(0, reg.write_index); =20 + /* Register without separator spacing should still match */ + reg.enable_bit =3D 29; + reg.name_args =3D (__u64)"__test_event u32 field1;u32 field2"; + ASSERT_EQ(0, ioctl(self->data_fd, DIAG_IOCSREG, ®)); + ASSERT_EQ(0, reg.write_index); + /* Multiple registers to same name but different args should fail */ reg.enable_bit =3D 29; reg.name_args =3D (__u64)"__test_event u32 field1;"; @@ -288,6 +294,8 @@ TEST_F(user, register_events) { ASSERT_EQ(0, ioctl(self->data_fd, DIAG_IOCSUNREG, &unreg)); unreg.disable_bit =3D 30; ASSERT_EQ(0, ioctl(self->data_fd, DIAG_IOCSUNREG, &unreg)); + unreg.disable_bit =3D 29; + ASSERT_EQ(0, ioctl(self->data_fd, DIAG_IOCSUNREG, &unreg)); =20 /* Delete should have been auto-done after close and unregister */ close(self->data_fd); --=20 2.43.0