mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
Fprobe entry and exit callbacks execute in atomic context with preemption disabled under ftrace recursion protection. Calling printk() directly inside handlers can lead to deadlocks if console or scheduler locks are already held by the probed or interrupted context. Drop the use_trace module parameter and always use trace_printk() for handler logging. In addition, replace stack_trace_print() (which uses printk()) with trace_dump_stack(0) to output backtraces safely to the ftrace buffer. Also update the module header comment to reference /sys/kernel/tracing/trace. Additionally, update CONFIG_SAMPLE_FPROBE in samples/Kconfig to depend on EVENT_TRACING so that the tracing subsystem is enabled when building the sample. Link: https://lore.kernel.org/all/179360347512.115681.7201999490892291449.stgit@devnote2/ Signed-off-by: Masami Hiramatsu (Google) <[email protected]>