Failed to Attach Kprobe: File Already Exists in `/sys/kernel/debug/tracing/kprobe_events`
shun159 opened this issue · 3 comments
When attempting to run multiple same kprobe program simultaneously, the application fails to attach the kprobe and throws the following error:
2023/09/18 23:02:18 failed to attach kprobe: write /sys/kernel/debug/tracing/kprobe_events: file exists
Steps to Reproduce:
- Run kprobe program 1
- Run kprobe program 2
Actual Results:
The secondary fails to start and throws the error mentioned above.
Hi, if I understand correctly are you trying to attach kprobes for two different functions and it is failing? If so which functions are you trying to attach?
(Really sorry I submitted the patch by mistake. I'm just trying in my fork)
Hello, I attempting to run multiple same kprobe program that attach the same function simultaneously.
Here is an example I wrote while experimenting with kprobe. The code attaches to do_nanosleep: link.
Hi @jayanthvn
I believe the error is caused by a collision of event names in kprobe_events. Is this the expected behavior?