Search code examples
linux-kerneltracelttng

Kernel trace using Lttng


I have been playing around with linux trace tools (Lttng, http://lttng.org/) for sometime now. Currently, I'm interpreting the trace using Eclipse with Lttng plug-in. Although using this tool I could retrieve logs associated with system calls, context switches, I couldn't find a way to trace a particular event occurring at a specific location say an interrupt raised by a peripheral. I also tried my hand at KProbes for dynamic tracing but in vain. Any suggestions/guidance will be useful and highly appreciated.


Solution

  • If you know which function you want to instrument, I recommend you try the "--function" lttng option to instrument a specific function entry/exit. "--probe" allows you to put a breakpoint at a specific symbol and offset or at a specific address. See the lttng(1) manpage for details.

    Another way to reach your goal would be to use tracepoints that target IRQ entry. You can list the kernel tracepoints with lttng list -k, and then enable specifically the irq entry tracepoints. Then, you'll have to use e.g. grep to find the appropriate IRQ numbers you are looking for within your trace. As of lttng 2.1, the "grep" approach is the only approach that allow filtering on event content (content of a field). In a near future, we plan to port the filter bytecode interpreter from the LTTng Userspace Tracer (UST) to the lttng kernel tracer (lttng-modules).

    Best Regards,

    Mathieu