Hi Stephan,

As you might have guessed, one of our goals has been to be able to run 
the libpfm examples cleanly on Power.

multiplex.c gives odd error messages about calls to pfm_write_pmds and 
pfm_write_pmcs depending on the options given.  I tracked this down to 
the allocation of the all_pmcs array on line 1146:

       all_pmcs   = calloc(1, sizeof(pfarg_pmc_t)*total_events);

The number of PKCs on to allocate on Power is not directly related to 
the total events.  In this case, there are four total events, but we 
need 6 pmc registers (3 for each set).  On Power, it's always 3 
registers per set.  I would guess that other architectures might have 
similar issues.

Because not enough space is allocated, we end up overwriting memory that 
  is located after the array, causing corruption of memory.  This 
results in various bad things happening, as you might imagine.

As a temporary work-around, I changed the multiplier from total_events 
to just '20'.  This fixed the problem and the test runs correctly, at 
least with the default options.

Any ideas about a better fix than this?

Regards,

- Corey

Corey Ashford
Software Engineer
IBM Linux Technology Center, Linux Toolchain
Beaverton, OR
503-578-3507
[email protected]


------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to