Re: Get local CPU id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 08 Mar 2015 22:49:00 +0100, Maxime Ripard said:

> On Sun, Mar 08, 2015 at 10:06:23PM +0300, Matwey V. Kornilov wrote:

> > 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.

Clarification:  /proc/interrupts will give userspace that information.
It is *not* recommended you try to read it from kernel space, much less
from an interrupt context... :)

Attachment: pgpIRBjPBjsh6.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux