1

I am registering a probe function for trace events using a Kernel module. For eg the probe function for the trace event sched_kthread_stop would be:

void handle_kthread_stop(void *data, struct task_struct *t)

And register this using

tracepoint_probe_register()

Now an actual trace in the trace buffer looks like this:

bash-9002  [000] d..5  2145.303974: sched_wakeup: comm=kworker/u8:1 pid=46 prio=120 target_cpu=003

Here [000] is the CPU ID. I want to get this CPU ID info in the probe function.

Can someone tell me how to get the CPU ID in the probe function?

0 Answers0