On Mon, 2006-07-17 at 05:58 -0700, Stephane Eranian wrote:
> Dave,
> 
> On Mon, Jul 17, 2006 at 08:51:40AM -0400, Dave Nellans wrote:
> > I'm experiencing some flaky behavior while using the kernel api. 
> > 
> > i'm running a bash script to loads and unloads a module similarly to the
> > one originall posted by william cohen.  19/20 times i'm getting the
> > expected results from my test program, but 1/20 returns abnormally.
> > 
> > in every case all the setup functions return properly, the problems seem
> > to start on pfmk_stop where i get a -16 returned occassionally which
> > then causes pfmk_read_pmds and pfmk_unload_context to fail both with -16
> > afterwards.
> > 
> > is pfmk_stop something that i should count on failing once in a while
> > and can safely be checked an called multiple times or is an underlying
> > problem?
> > 
> 
> Something to keep in mind with KAPI is that it works only in system-wide
> mode. In SMP mode, you need to create aperfmon context for bind it
> (with pfm_load_context) onto each processor. For that you need to issue
> the pfm_load_context() ON the CPU you want to monitor. Perfmon does not
> propagate PMU settings from one CPU to another one. I suspect that the
> EBUSY you're getting is because you are trying to execute a command on
> the wrong CPU for a given context.
> 

Great diagnosis Stephane, disabling SMP support in the kernel shows the
problem has been eliminated. I was aware of the limitation for per cpu
monitoring but wasn't thinking about the possibility of my module code
being migrated off the cpu it was initialized on.

is there an easy way to pin in-kernel code to a specific cpu using the
affinity functions to prevent this from happening?  i use the affinity
functions regularly but on user processes typically; so don't know if my
module code would be part of a migratable/pinnable kernel level thread
or process.

-dave
-- 
Dave Nellans
[EMAIL PROTECTED]
http://www.nellans.org/~dwn/

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/

Reply via email to