diff options
author | sunliming <sunliming@kylinos.cn> | 2023-06-26 14:13:43 +0300 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-06-28 18:01:35 +0300 |
commit | c27b40cf919254459698d6622828152b509b9980 (patch) | |
tree | 6547bc71bdab57c9a7aaa4f3572867331bbedd5d /tools/testing | |
parent | f6d026eea390d59787a6cdc2ef5c983d02e029d0 (diff) | |
download | linux-c27b40cf919254459698d6622828152b509b9980.tar.xz |
selftests/user_events: Enable the event before write_fault test in ftrace self-test
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 <beaub@linux.microsoft.com>
Signed-off-by: sunliming <sunliming@kylinos.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/user_events/ftrace_test.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/user_events/ftrace_test.c b/tools/testing/selftests/user_events/ftrace_test.c index eb6904d89f14..88898749e5b7 100644 --- a/tools/testing/selftests/user_events/ftrace_test.c +++ b/tools/testing/selftests/user_events/ftrace_test.c @@ -400,6 +400,10 @@ TEST_F(user, write_fault) { ASSERT_EQ(0, ioctl(self->data_fd, DIAG_IOCSREG, ®)); ASSERT_EQ(0, reg.write_index); + /* Enable event */ + self->enable_fd = open(enable_file, O_RDWR); + ASSERT_NE(-1, write(self->enable_fd, "1", sizeof("1"))) + /* Write should work normally */ ASSERT_NE(-1, writev(self->data_fd, (const struct iovec *)io, 2)); |