Get local CPU id

Maxime Ripard maxime.ripard at free-electrons.com
Sun Mar 8 17:49:00 EDT 2015


On Sun, Mar 08, 2015 at 10:06:23PM +0300, Matwey V. Kornilov 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?

To answer strictly your question, like Nick said, smp_processor_id()
will work fine.

However, you can do exactly what you want be reading /proc/interrupts,
that already provide the informations you are looking for.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150308/864d20b8/attachment.bin 


More information about the Kernelnewbies mailing list