> 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to