Skip to content

Commit

Permalink
selftests/user_events: Enable the event before write_fault test in ft…
Browse files Browse the repository at this point in the history
…race 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>
  • Loading branch information
sunliming authored and Steven Rostedt (Google) committed Jun 28, 2023
1 parent f6d026e commit c27b40c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/testing/selftests/user_events/ftrace_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ TEST_F(user, write_fault) {
ASSERT_EQ(0, ioctl(self->data_fd, DIAG_IOCSREG, &reg));
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));

Expand Down

0 comments on commit c27b40c

Please sign in to comment.