All of lore.kernel.org
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Get local CPU id
Date: Mon, 9 Mar 2015 13:59:47 +0100	[thread overview]
Message-ID: <20150309125947.GQ5085@lukather> (raw)
In-Reply-To: <208859.1425853847@turing-police.cc.vt.edu>

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 

  parent reply	other threads:[~2015-03-09 12:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-08 19:06 Get local CPU id Matwey V. Kornilov
2015-03-08 20:41 ` Nicholas Krause
2015-03-08 21:49 ` Maxime Ripard
2015-03-08 22:03   ` Nicholas Krause
2015-03-08 22:30   ` Valdis.Kletnieks at vt.edu
2015-03-08 23:10     ` Nicholas Krause
2015-03-09 14:39       ` Maxime Ripard
2015-03-09 12:59     ` Maxime Ripard [this message]
2015-03-09  0:37 ` Anish Kumar
2015-03-09  0:52   ` Nicholas Krause
2015-03-09 15:35 ` Matwey V. Kornilov
2015-03-09 16:26   ` Jeff Haran
2015-03-09 17:42     ` Nick Krause
2015-03-09 18:10       ` Valdis.Kletnieks at vt.edu
2015-03-09 20:05         ` Nicholas Krause

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150309125947.GQ5085@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.