From owner-freebsd-hackers Tue Oct 24 13:44:34 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-202-176-145.dsl.snfc21.pacbell.net [63.202.176.145]) by hub.freebsd.org (Postfix) with ESMTP id 57C7537B479 for ; Tue, 24 Oct 2000 13:44:32 -0700 (PDT) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.11.0/8.9.3) with ESMTP id e9OKmPh02075; Tue, 24 Oct 2000 13:48:25 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200010242048.e9OKmPh02075@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: "Christopher Harrer" Cc: "Freebsd-Hackers" Subject: Re: Determining CPU on SMP box In-reply-to: Your message of "Tue, 24 Oct 2000 07:37:12 EDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 24 Oct 2000 13:48:25 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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