devlib icon indicating copy to clipboard operation
devlib copied to clipboard

ftrace: Preserve kprobe events during trace-cmd reset

Open metin-arm opened this issue 1 year ago • 1 comments

FtraceCollector.reset() executes 'trace-cmd reset ..' command which clears all kprobes. This breaks tracing existing kprobe events (if any). Thus, save kprobe events before trace-cmd reset and restore them after the reset operation.

For the context, I want to trace an ordinary function in kernel (e.g., "echo 'p do_sys_open' > /sys/kernel/tracing/kprobe_events"). However, FtraceCollector.reset() destroys kprobes, too. Preserving existing kprobes allows me to use FtraceCollector class as is.

Signed-off-by: Metin Kaya [email protected]

metin-arm avatar Sep 23 '24 10:09 metin-arm

Filed a question to check if we can introduce a new flag in trace-cmd to exclude resetting existing kprobe events.

metin-arm avatar Sep 23 '24 12:09 metin-arm