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. -- -Stephane _______________________________________________ perfmon mailing list [email protected] http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/
