I want to print CPU number on which the current process or function is executing similar to ftrace like this:
TASK-PID CPU# TIMESTAMP FUNCTION
| | | | |
<idle>-0 [002] 23636.756054: ttwu_do_activate.constprop.89 <-try_to_wake_up
<idle>-0 [002] 23636.756054: activate_task <-ttwu_do_activate.constprop.89
<idle>-0 [002] 23636.756055: enqueue_task <-activate_task
How do I get that value? I suppose its there in some function of start_kernel
function. Can we print its value? I am using linux-4.1
kernel.