Phil,

On Wed, Nov 08, 2006 at 11:21:21AM +0100, Philip J. Mucci wrote:
> > Yes. This does not work on P6 because of the single enable bit 
> > for all counters. It works only on AMD64 and Intel Core 2.
> > The P4 has other issues I have not yet solved.
> 
> Hi,
> 
> Ok, I'm guessing that shouldn't P6/Perfmon disable itself in this case?
> There's no error thrown to the user about 'unusable PMC hardware'
> although I did see something in the syslog. I think create_context
> should fail in this case.
> 
There is a check in the PMU description module (perfmon_p6.c). It should
trigger and fail if it detect NMI watchdog is active on your laptop. in
other words, you cannot insert the module, thus you cannot create
any perfmon context. But maybe I fixed that only in my current 2.6.19-rc5 
codebase.

> > > 
> > > I noticed that there is a set of calls for implemented counters AND a
> > > set of calls for available counters (using the eventset). Couldn't these
> > > two me merged? From an application standpoint, all we care about is what
> > > we can use...is there ever a reason to check 'impl' when using 'avail'?
> > > 
> > Are you talking about libpfm or pfm_getinfo-evtsets()?
> 
> Both....it's the combination of impl from libpfm and avail from the
> kernel. Seems like they should be combined.
> 
Remember that libpfm and the kernel perfmon are disconnected. There is
no call from libpfm to the kernel interface. That is why the detect_pmcs
logic is part of the example and not the library. the only dependency
that existed is the mapping for PMC and PMD registers, libpfm is guaranteed
to use the same mapping as perfmon. But it also provides the hardware addresses
so you can use the data in another environment.

The get_impl*() libpfm calls returns what the FULL PMU does provide. You then
have to check using the kernel interface, what you have available to you due
to sharing of the PMU with other users (e.g., system-wide session) or subsystems
(e.g. NMI). That check is external to the library. The pfm_getinfo_evtsets()
returns what you have available at the time you make the call. If the context
is unloaded and register allocation changes, then pfm_load_context() may fail.
Note that this part is not yet implemented and needs some more thoughts.

-- 

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

Reply via email to