I work in a system that does not allow me to enable tracepoints at runtime. To work around this, I manually add printks near a trace point to during debugging. This seems to be very inefficient and I am looking for methods to enable a tracepoint at compile time and have it pushed to the kernel log ring buffer.
Asked
Active
Viewed 115 times
1 Answers
0
You can use the kernel kprobes to dynamically register probe functions into the kernel. probe functions are just kernel modules that are dynamically inserted into your kernel and from there you can print to ring buffer. kprobes are automatically enabled on nearly all major linux distro's by default. see the documentation to know how to register and unregister kprobes.

KMG
- 1,433
- 1
- 8
- 19
-
I'm aware of that; the question is when you _cannot_ do dynamic tracing and want some pre-exiting "tracepoints" to be turned on at compile time. – sidcha Aug 29 '22 at 07:31