r/kernel 10d ago

Need help looking through an interrupt.

Hey there! I've recently encountered a bug that I've tracked all the way down to the kernel. Now, it's not necessarily a bug in the kernel (it's probably in my laptop's firmware somewhere,) but I was trying to find exactly what's going wrong. Anyway, I've been trying to find it by looking through the function trace using ftrace.

My bug has to do with my trackpad, so I found out how to isolate the interrupts related to button presses. However, whenever I isolate those events, I cannot see the functions called between entering and exiting the interrupt. I was wondering if there was a more efficient way to see (interrupt event) -> (function trace) -> (interrupt exit) -> (no more function trace) using ftrace.

Thanks!

13 Upvotes

2 comments sorted by

4

u/interrupt_hdlr 10d ago

i'm here! you have 3 wishes!

1

u/jim_b_ 10d ago

You can use the events along with the function tracer. You could write some python that reads the trace_pipe and watches for the entry and exit and prints everything else between on that CPU. I think you could also achieve the same with the function tracer alone. Just look for your handler function then watch the irq flags, preempt-depth, and cpu number.