Re: [PATCH v2] arch/riscv: Enable kprobes when CONFIG_MODULES=n
From: "Jarkko Sakkinen" <jarkko@kernel.org>
Date: 2024-03-23 23:31:27
Also in:
linux-riscv, lkml
From: "Jarkko Sakkinen" <jarkko@kernel.org>
Date: 2024-03-23 23:31:27
Also in:
linux-riscv, lkml
On Sun Mar 24, 2024 at 1:29 AM EET, Jarkko Sakkinen wrote:
Tracing with kprobes while running a monolithic kernel is currently impossible due the kernel module allocator dependency. Address the issue by allowing architectures to implement module_alloc() and module_memfree() independent of the module subsystem. An arch tree can signal this by setting HAVE_KPROBES_ALLOC in its Kconfig file. Realize the feature on RISC-V by separating allocator to module_alloc.c and implementing module_memfree(). Link: https://www.sochub.fi # for power on testing new SoC's with a minimal stack Link: https://lore.kernel.org/all/20220608000014.3054333-1-jarkko@profian.com/ (local) # continuation Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
As for testing I tried the kprobes example for boottime tracing dcoumentation: https://www.kernel.org/doc/html/v5.7/trace/boottime-trace.html I.e. ftrace.event { kprobes.vfs_read { probes = "vfs_read $arg1 $arg2" filter = "common_pid < 100" enable } } kernel { console = hvc0 earlycon = sbi trace_options = sym-addr trace_event = "initcall:*" tp_printk dump_on_oops = 2 trace_buf_size = 1M } BR, Jarkko