Hi Stephane,

I recently modified the perf tool to use libpfm4 (the modifications are against 
2.6.31, and I haven't posted them to LKML yet).

One issue I ran into, though, is error checking in libpfm4 is not real helpful 
to a user.  Basically, if they supply an incorrect event specification string, 
libpfm4 just returns PFM_ERR_INVAL, and doesn't give them much of a clue as to 
what exactly is wrong.  My first thought was that the error code is ok, but 
inside the arch specific code, I need to do a better job of emitting error 
messsages via DPRINT, as is done for x86 processors in pfmlib_intel_x86.c for 
example.

So I added a bunch of DPRINT statements, and then enabled debug output via the 
environment variable "LIBPFM_DEBUG", set to "1".

Using this technique, I do indeed get error message output, but I also get a 
*lot* of other narrative output, mostly from get_tracepoint_table in 
pfmlib_perf_event_pmu.c.  So I have temporarily disabled the output from that 
function in my local copy of libpfm4.

I see another mechanism in libpfm4, LIBPFM_VERBOSE.  If it is set, calls to 
__pfm_vbprintf funnel output to stderr or stdout (if LIBPFM_DEBUG_STDOUT is 
set).  There are a lot of usages of __pfm_vbprintf in the arch-specific code, 
but it all appears to be narrative/debug information, instead of verbose error 
messages.

What is the intention behind these two environment variables.  Do you have 
suggestions as to which way to go with this?  Should there be a level or mask 
code introduced into the DPRINT statement, so users can be a bit more selective 
about what output they want?  Should the usage for these two mechanisms be 
spelled out?  Should the code in get_tracepoint_table be changed to use 
__pfm_vbprintf instead of DPRINT?

There's no rush on this, but I think it's an area that could use some 
refinement.

Thanks for your consideration,

- Corey

Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR
503-578-3507
cjash...@us.ibm.com


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to