Get local CPU id

Nicholas Krause xerofoify at gmail.com
Sun Mar 8 16:41:04 EDT 2015



On March 8, 2015 3:06:23 PM EDT, "Matwey V. Kornilov" <matwey.kornilov at gmail.com> wrote:
>Hi,
>
>I would like to somehow obtain local CPU core ID in the interrupt
>handler function. I want to see how my interruptions are distributed
>among different CPU cores under different conditions.
>
>How should I do that?
>
>
I didn't remember off hand but looked into the scheduler code where this is common.  When I looked there the marco, smp_professor_id in the file include/linux/smp. h seems to be the best way to handle your task. The only concern and I am pretty certain it is, is if this marco is
able to work in interrupt context a.k.a it is guaranteed to  never sleep. You can either test this out and see if the system hangs or do more research into what functions and marcos work interrupt context. 
Hope this helps, 
Nick 
>_______________________________________________
>Kernelnewbies mailing list
>Kernelnewbies at kernelnewbies.org
>http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



More information about the Kernelnewbies mailing list