Best way to convert a Linux kernel trace point into a plain old printk

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.

Upvotes: 0

Views: 188

Answers (1)

KMG
KMG

Reputation: 1511

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.

Upvotes: 0

Related Questions