Re: [RFC PATCH 07/13] mm/kstackwatch: Add kprobe and stack watch control
From: Jinchao Wang <hidden>
Date: 2025-08-25 13:11:38
Also in:
linux-mm, lkml
From: Jinchao Wang <hidden>
Date: 2025-08-25 13:11:38
Also in:
linux-mm, lkml
On 8/25/25 18:31, Masami Hiramatsu (Google) wrote:
On Mon, 18 Aug 2025 20:26:12 +0800 Jinchao Wang [off-list ref] wrote:quoted
This patch adds the core logic for controlling the kernel stack watch mechanism using a combination of kprobes and kretprobes. A kprobe is registered at function + ip_offset to turn on the hardware breakpoint that monitors the stack. This allows the tool to begin watching from a specific instruction within the function. At the same time, a kretprobe is registered to be triggered when the function returns. Its handler is responsible for turning off the hardware breakpoint.Could you use fprobe instead of kretprobe for hooking function exit? kretprobe is an old feature and will be replaced by fprobe. You can find an example in samples/fprobe/fprobe_example.c Thank you,
Hi Masami, Thanks for the feedback. I will respin the patchset and replace the kretprobe with fprobe, as you advised. -- Best regards, Jinchao