<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/selftests/user_events, branch v6.6.131</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.131</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.131'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-11-24T09:30:08+00:00</updated>
<entry>
<title>selftests/user_events: fix type cast for write_index packed member in perf_test</title>
<updated>2025-11-24T09:30:08+00:00</updated>
<author>
<name>Ankit Khushwaha</name>
<email>ankitkhushwaha.linux@gmail.com</email>
</author>
<published>2025-11-06T09:55:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2612f0e0b8dcf8a3402b433693a316cb40e7332d'/>
<id>urn:sha1:2612f0e0b8dcf8a3402b433693a316cb40e7332d</id>
<content type='text'>
commit 216158f063fe24fb003bd7da0cd92cd6e2c4d48b upstream.

Accessing 'reg.write_index' directly triggers a -Waddress-of-packed-member
warning due to potential unaligned pointer access:

perf_test.c:239:38: warning: taking address of packed member 'write_index'
of class or structure 'user_reg' may result in an unaligned pointer value
[-Waddress-of-packed-member]
  239 |         ASSERT_NE(-1, write(self-&gt;data_fd, &amp;reg.write_index,
      |                                             ^~~~~~~~~~~~~~~

Since write(2) works with any alignment. Casting '&amp;reg.write_index'
explicitly to 'void *' to suppress this warning.

Link: https://lkml.kernel.org/r/20251106095532.15185-1-ankitkhushwaha.linux@gmail.com
Fixes: 42187bdc3ca4 ("selftests/user_events: Add perf self-test for empty arguments events")
Signed-off-by: Ankit Khushwaha &lt;ankitkhushwaha.linux@gmail.com&gt;
Cc: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Cc: "Masami Hiramatsu (Google)" &lt;mhiramat@kernel.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: sunliming &lt;sunliming@kylinos.cn&gt;
Cc: Wei Yang &lt;richard.weiyang@gmail.com&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/user_events: Fix abi_test for BE archs</title>
<updated>2023-10-17T21:07:19+00:00</updated>
<author>
<name>Beau Belgrave</name>
<email>beaub@linux.microsoft.com</email>
</author>
<published>2023-10-05T21:57:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf5a103c98a6fb9ee3164334cb5502df6360749b'/>
<id>urn:sha1:cf5a103c98a6fb9ee3164334cb5502df6360749b</id>
<content type='text'>
The abi_test currently uses a long sized test value for enablement
checks. On LE this works fine, however, on BE this results in inaccurate
assert checks due to a bit being used and assuming it's value is the
same on both LE and BE.

Use int type for 32-bit values and long type for 64-bit values to ensure
appropriate behavior on both LE and BE.

Fixes: 60b1af8de8c1 ("tracing/user_events: Add ABI self-test")
Signed-off-by: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Acked-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/user_events: Fix to unmount tracefs when test created mount</title>
<updated>2023-09-18T17:04:52+00:00</updated>
<author>
<name>Beau Belgrave</name>
<email>beaub@linux.microsoft.com</email>
</author>
<published>2023-09-15T22:27:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ed99af4a266a3492d773b5d85c3f8e9f81254b6'/>
<id>urn:sha1:8ed99af4a266a3492d773b5d85c3f8e9f81254b6</id>
<content type='text'>
Fix to unmount tracefs if the self-test mounted it to allow testing.
If tracefs was already mounted, this does nothing.

Suggested-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/all/29fce076-746c-4650-8358-b4e0fa215cf7@sirena.org.uk/
Fixes: a06023a8f78d ("selftests/user_events: Fix failures when user_events is not installed")

Signed-off-by: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: user_events: create test-specific Kconfig fragments</title>
<updated>2023-09-11T23:06:48+00:00</updated>
<author>
<name>Naresh Kamboju</name>
<email>naresh.kamboju@linaro.org</email>
</author>
<published>2023-09-07T08:02:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7ab6fe6625c9bdcb8fa5f61c8f8e30e13f689284'/>
<id>urn:sha1:7ab6fe6625c9bdcb8fa5f61c8f8e30e13f689284</id>
<content type='text'>
Create the config file in user_events directory of testcase which
need more kernel configuration than the default defconfig. User
could use these configs with merge_config.sh script:

The Kconfig CONFIG_USER_EVENTS=y is needed for the test to read
data from the following files,
  - "/sys/kernel/tracing/user_events_data"
  - "/sys/kernel/tracing/user_events_status"
  - "/sys/kernel/tracing/events/user_events/*"

Enable config for specific testcase:
(export ARCH=xxx #for cross compiling)
./scripts/kconfig/merge_config.sh .config \
                tools/testing/selftests/user_events/config

Enable configs for all testcases:
(export ARCH=xxx #for cross compiling)
./scripts/kconfig/merge_config.sh .config \
                tools/testing/selftests/*/config

Cc: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/user_events: Fix failures when user_events is not installed</title>
<updated>2023-09-11T23:04:11+00:00</updated>
<author>
<name>Beau Belgrave</name>
<email>beaub@linux.microsoft.com</email>
</author>
<published>2023-09-08T20:19:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a06023a8f78d3e9e73ca4363ccf3871a06e16ecc'/>
<id>urn:sha1:a06023a8f78d3e9e73ca4363ccf3871a06e16ecc</id>
<content type='text'>
When user_events is not installed the self tests currently fail. Now
that these self tests run by default we need to ensure they don't fail
when user_events was not enabled for the kernel being tested.

Add common methods to detect if tracefs and user_events is enabled. If
either is not enabled skip the test. If tracefs is enabled, but is not
mounted, mount tracefs and fail if there were any errors. Fail if not
run as root.

Fixes: 68b4d2d58389 ("selftests/user_events: Reenable build")
Reported-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Link: https://lore.kernel.org/all/CA+G9fYuugZ0OMeS6HvpSS4nuf_A3s455ecipGBvER0LJHojKZg@mail.gmail.com/

Signed-off-by: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/user_events: Reenable build</title>
<updated>2023-08-16T16:29:57+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2023-08-06T11:29:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=68b4d2d58389f9d1db7ffc02644498f215ee8c70'/>
<id>urn:sha1:68b4d2d58389f9d1db7ffc02644498f215ee8c70</id>
<content type='text'>
The user_events selftests were removed from the standard set of
selftests due to the uapi header it relies on having been temporarily
removed.  That header is now reinstated so we can reenable the tests.

Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/user_events: Test struct size match cases</title>
<updated>2023-07-12T16:04:47+00:00</updated>
<author>
<name>Beau Belgrave</name>
<email>beaub@linux.microsoft.com</email>
</author>
<published>2023-06-29T23:50:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=769e637276c294c2254f698e6a57eda771deb3f7'/>
<id>urn:sha1:769e637276c294c2254f698e6a57eda771deb3f7</id>
<content type='text'>
The self tests for user_events currently does not ensure that the edge
case for struct types work properly with size differences.

Add cases for mis-matching struct names and sizes to ensure they work
properly.

Link: https://lkml.kernel.org/r/20230629235049.581-3-beaub@linux.microsoft.com

Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests/user_events: Add test cases when event is disabled</title>
<updated>2023-06-28T15:01:35+00:00</updated>
<author>
<name>sunliming</name>
<email>sunliming@kylinos.cn</email>
</author>
<published>2023-06-26T11:13:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d34a271accf8fad00e05aad2cecb9fb53a840a94'/>
<id>urn:sha1:d34a271accf8fad00e05aad2cecb9fb53a840a94</id>
<content type='text'>
When user_events are disabled, it's write operation should return -EBADF.
Add this test cases.

Link: https://lkml.kernel.org/r/20230626111344.19136-4-sunliming@kylinos.cn

Acked-by: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Signed-off-by: sunliming &lt;sunliming@kylinos.cn&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests/user_events: Enable the event before write_fault test in ftrace self-test</title>
<updated>2023-06-28T15:01:35+00:00</updated>
<author>
<name>sunliming</name>
<email>sunliming@kylinos.cn</email>
</author>
<published>2023-06-26T11:13:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c27b40cf919254459698d6622828152b509b9980'/>
<id>urn:sha1:c27b40cf919254459698d6622828152b509b9980</id>
<content type='text'>
The user_event has not be enabled in write_fault test in ftrace
self-test, Just enable it.

Link: https://lkml.kernel.org/r/20230626111344.19136-3-sunliming@kylinos.cn

Acked-by: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Signed-off-by: sunliming &lt;sunliming@kylinos.cn&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>selftests/user_events: Adapt dyn_test to non-persist events</title>
<updated>2023-06-14T17:43:27+00:00</updated>
<author>
<name>Beau Belgrave</name>
<email>beaub@linux.microsoft.com</email>
</author>
<published>2023-06-14T16:33:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=61701242e86f0b509a0f5f9deb226bedfc8dfab7'/>
<id>urn:sha1:61701242e86f0b509a0f5f9deb226bedfc8dfab7</id>
<content type='text'>
Now that user_events does not honor persist events the dynamic_events
file cannot be easily used to test parsing and matching cases.

Update dyn_test to use the direct ABI file instead of dynamic_events so
that we still have testing coverage until persist events and
dynamic_events file integration has been decided.

Link: https://lkml.kernel.org/r/20230614163336.5797-6-beaub@linux.microsoft.com

Signed-off-by: Beau Belgrave &lt;beaub@linux.microsoft.com&gt;
Signed-off-by: Steven Rostedt (Google) &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
