From mboxrd@z Thu Jan 1 00:00:00 1970 From: maxime.ripard@free-electrons.com (Maxime Ripard) Date: Mon, 9 Mar 2015 13:59:47 +0100 Subject: Get local CPU id In-Reply-To: <208859.1425853847@turing-police.cc.vt.edu> References: <20150308214900.GN5085@lukather> <208859.1425853847@turing-police.cc.vt.edu> Message-ID: <20150309125947.GQ5085@lukather> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Sun, Mar 08, 2015 at 06:30:47PM -0400, Valdis.Kletnieks at vt.edu wrote: > 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... :) Hmmm, yes, it was a little too obvious in my mind :) Thanks for the clarification! 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/20150309/d0fa3796/attachment.bin