Date: Wed, 25 Oct 2000 08:47:00 -0400 From: "Christopher Harrer" <charrer@alacritech.com> To: "Mike Smith" <msmith@freebsd.org> Cc: "Freebsd-Hackers" <freebsd-hackers@FreeBSD.ORG> Subject: RE: Determining CPU on SMP box Message-ID: <POELKPJGDHAPIPMEMHGAMEPACIAA.charrer@alacritech.com> In-Reply-To: <200010242048.e9OKmPh02075@mass.osd.bsdi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Mike, Thanks for the response. As I said, the reason for this is diagnostic information. Especially wanting to know if I got reshceduled on another CPU. I'll look for this cpuid. Chris -----Original Message----- From: owner-freebsd-hackers@FreeBSD.ORG [mailto:owner-freebsd-hackers@FreeBSD.ORG]On Behalf Of Mike Smith Sent: Tuesday, October 24, 2000 4:48 PM To: Christopher Harrer Cc: Freebsd-Hackers Subject: Re: Determining CPU on SMP box > Is there a way to determine which CPU I'm currently executing on in a SMP > box? I've found references to proc->p_oncpu, but I'm not sure if this is > the best way to determine where I'm executing. I'd like to be able to > "trace" various actions within my driver and one of the fields I want to > keep track of is what CPU I'm executing on. There's a per-CPU variable 'cpuid' (at least, there used to be) that you could use for this. However, it's kinda pointless working out what CPU you're on, since you're liable to be rescheduled onto another CPU if an interrupt occurs... -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?POELKPJGDHAPIPMEMHGAMEPACIAA.charrer>