wangt13
wangt13

Reputation: 1215

Failed to trace the trace point of softirq_raise in Linux-5.11.4

I am writing a kernel module to hook to the trace point of softirq_raise. I found it could be shown in

/sys/kernel/debug/tracing/available_events:irq:softirq_raise   
/sys/kernel/debug/tracing/available_filter_functions:__traceiter_softirq_raise

My handler is as follows,

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 = %d\n", smp_processor_id(), vec);
        }
        count ++;
    }
}

and what I got is as follows,

[ 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

To my surprise, it showed only vec_nr = 0, no other softirq is being raised.
But /proc/softirqs does show lots of different softirqs on CPU5.
Is there anything wrong in my handler?

Upvotes: 0

Views: 135

Answers (1)

wangt13
wangt13

Reputation: 1215

The arguments to the probe handler is wrong, it should be

static void probe_softirq_raise(void *data, unsigned int vec)

Upvotes: 1

Related Questions