Date: Tue, 25 Oct 2011 21:20:00 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: John Baldwin <jhb@freebsd.org> Cc: freebsd-current@freebsd.org, Luigi Rizzo <rizzo@iet.unipi.it> Subject: Re: getting the cpuid for a userspace process ? Message-ID: <20111025182000.GU50300@deviant.kiev.zoral.com.ua> In-Reply-To: <201110251342.45194.jhb@freebsd.org> References: <20111025150622.GA7462@onelab2.iet.unipi.it> <201110251342.45194.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--1vbNym9KGxCl/IZ3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 25, 2011 at 01:42:45PM -0400, John Baldwin wrote: > On Tuesday, October 25, 2011 11:06:22 am Luigi Rizzo wrote: > > as the subject says... is there any way to get the current > > CPU id for a userspace process (of course, > > valid only at the time the function is called as the > > process might be arbitrarily moved while it runs) >=20 > Not from userland, no. On x86 you can use cpuid to fetch the APIC ID, bu= t=20 > that does not map 1:1 to FreeBSD cpu IDs. Not quite so. The kern.proc sysctls do provide oncpu and lastcpu information, which, I believe, is used by top. But this is very slow way to get cpu id. --1vbNym9KGxCl/IZ3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6m/c8ACgkQC3+MBN1Mb4j1dgCg6hOi9CjFs6lPOrYRDQ84Ti5z BGgAoNh8CTsfH2Jw+7JXvGg4/dzyzkXz =pMon -----END PGP SIGNATURE----- --1vbNym9KGxCl/IZ3--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111025182000.GU50300>