On 11/06/25 6:05 pm, Lorenzo Stoakes wrote:
Thanks for this!

On Wed, Jun 11, 2025 at 05:40:11PM +0530, Dev Jain wrote:
If CONFIG_UPROBES is not set, a merge subtest fails:

Failure log:

   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

CONFIG_UPROBES is enabled by CONFIG_UPROBE_EVENTS, which gets enabled by
CONFIG_FTRACE. Therefore add this config to selftests/mm/config so that
CI systems can include this config in the kernel build.
OK I see the dependency chain here:

menuconfig FTRACE
      bool "Tracers"
      depends on TRACING_SUPPORT
      default y if DEBUG_KERNEL
      help
        Enable the kernel tracing infrastructure.

if FTRACE

...

endif # FTRACE

..

config UPROBE_EVENTS
      bool "Enable uprobes-based dynamic events"
      depends on ARCH_SUPPORTS_UPROBES
      depends on MMU
      depends on PERF_EVENTS
      select UPROBES
      select PROBE_EVENTS
      select DYNAMIC_EVENTS
      select TRACING
      default y

...


However we also need PERF_EVENTS w, which is defaulted to y if CONFIG_PROFILING
is set:

config PERF_EVENTS
      bool "Kernel performance events and counters"
      default y if PROFILING
      depends on HAVE_PERF_EVENTS
      select IRQ_WORK

...


config PROFILING
      bool "Profiling support"
      help
        Say Y here to enable the extended profiling support mechanisms used
        by profilers.

So maybe to be totally and completely pedantic we should add CONFIG_PROFILING
here too.

I don't totally understand this config stuff but I will trust you and update
this in v2 : )


Fixes: efe99fabeb11b ("selftests/mm: add test about uprobe pte be orphan during vma 
merge")
Reported-by: Aishwarya <[email protected]>
Closes: 
https://lore.kernel.org/all/[email protected]/
This is already (semi-)addressed by
https://lore.kernel.org/linux-mm/[email protected]/,
perhaps worth mentioning?

Pedro's patch is still important, as for any system that hasn't happened to set
this up, we get a skip + information rather than a failure.

Signed-off-by: Dev Jain <[email protected]>
This looks correct, see above for nits etc. but:

Reviewed-by: Lorenzo Stoakes <[email protected]>

Thanks.


---
  tools/testing/selftests/mm/config | 1 +
  1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/mm/config 
b/tools/testing/selftests/mm/config
index a28baa536332..e600b41030c1 100644
--- a/tools/testing/selftests/mm/config
+++ b/tools/testing/selftests/mm/config
@@ -8,3 +8,4 @@ CONFIG_GUP_TEST=y
  CONFIG_TRANSPARENT_HUGEPAGE=y
  CONFIG_MEM_SOFT_DIRTY=y
  CONFIG_ANON_VMA_NAME=y
+CONFIG_FTRACE=y
--
2.30.2

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

Reply via email to