Skip to content

Commit 3333871

Browse files
heatdakpm00
authored andcommitted
selftests/mm: skip uprobe vma merge test if uprobes are not enabled
If uprobes are not enabled, the test currently fails with: 7151 12:46:54.627936 # # # RUN merge.handle_uprobe_upon_merged_vma ... 7152 12:46:54.639014 # # f /sys/bus/event_source/devices/uprobe/type 7153 12:46:54.639306 # # fopen: No such file or directory 7154 12:46:54.650451 # # # merge.c:473:handle_uprobe_upon_merged_vma:Expected read_sysfs("/sys/bus/event_source/devices/uprobe/type", &type) (1) == 0 (0) 7155 12:46:54.650730 # # # handle_uprobe_upon_merged_vma: Test terminated by assertion 7156 12:46:54.661750 # # # FAIL merge.handle_uprobe_upon_merged_vma 7157 12:46:54.662030 # # not ok 8 merge.handle_uprobe_upon_merged_vma Skipping is a more sane and friendly behavior here. Link: https://lkml.kernel.org/r/[email protected] Fixes: efe99fa ("selftests/mm: add test about uprobe pte be orphan during vma merge") Signed-off-by: Pedro Falcato <[email protected]> Reported-by: Aishwarya <[email protected]> Closes: https://lore.kernel.org/linux-mm/[email protected]/ Reviewed-by: Lorenzo Stoakes <[email protected]> Tested-by : Donet Tom <[email protected]> Reviewed-by : Donet Tom <[email protected]> Reviewed-by: Dev Jain <[email protected]> Reviewed-by: Pu Lehui <[email protected]> Cc: Jann Horn <[email protected]> Cc: Liam Howlett <[email protected]> Cc: Mark Brown <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 95b2e31 commit 3333871

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/testing/selftests/mm/merge.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,9 @@ TEST_F(merge, handle_uprobe_upon_merged_vma)
470470
ASSERT_GE(fd, 0);
471471

472472
ASSERT_EQ(ftruncate(fd, page_size), 0);
473-
ASSERT_EQ(read_sysfs("/sys/bus/event_source/devices/uprobe/type", &type), 0);
473+
if (read_sysfs("/sys/bus/event_source/devices/uprobe/type", &type) != 0) {
474+
SKIP(goto out, "Failed to read uprobe sysfs file, skipping");
475+
}
474476

475477
memset(&attr, 0, attr_sz);
476478
attr.size = attr_sz;
@@ -491,6 +493,7 @@ TEST_F(merge, handle_uprobe_upon_merged_vma)
491493
ASSERT_NE(mremap(ptr2, page_size, page_size,
492494
MREMAP_MAYMOVE | MREMAP_FIXED, ptr1), MAP_FAILED);
493495

496+
out:
494497
close(fd);
495498
remove(probe_file);
496499
}

0 commit comments

Comments
 (0)