我正在编写一个内核模块来挂接到softirq_raise的跟踪点。我发现它可以在中显示
/sys/kernel/debug/tracing/available_events:irq:softirq_raise
/sys/kernel/debug/tracing/available_filter_functions:__traceiter_softirq_raise
我的处理程序如下,
static void probe_softirq_raise(unsigned int vec)
{
static u64 count = 0;
if (smp_processor_id() == 5) {
if ((count % 100) == 0) {
printk("XXXXXXX CPU = %d, vec = %dn", smp_processor_id(), vec);
}
count ++;
}
}
我得到的是,
[ 1835.220792] XXXXXXX CPU = 5, vec = 0
[ 1844.275244] XXXXXXX CPU = 5, vec = 0
[ 1853.488791] XXXXXXX CPU = 5, vec = 0
[ 1861.112794] XXXXXXX CPU = 5, vec = 0
[ 1868.336810] XXXXXXX CPU = 5, vec = 0
令我惊讶的是,它只显示vec_nr=0,没有提出其他softirq
但是/proc/softirqs确实在CPU5上显示了许多不同的softirqs.
我的处理程序有什么问题吗?
探测处理程序的参数是错误的,应该是
static void probe_softirq_raise(void *data, unsigned int vec)