Hello,

The main goal of this patch is to collapse the case statements that were 
being used to differentiate the Power PMU types.  The switch statements 
were needed because the number of group vectors and counters varied 
between Power processors, and to use the largest common sizes for all 
was considered to be a waste of memory.

To fix both issues, I've changed the data structures to use a common 
type definition for all Power processors, and then add a level of 
indirection which allows the arrays to be variable-sized.  This level of 
indirection does cost some extra memory space, but this is mitigated by 
the addition of the "const" keyword to the arrays, which cuts down the 
total memory used by the arrays by about half.

By using a common structure definition, we can use common code for all 
Power processors and eliminate the switch statements.  This common 
structure has been moved out of the processor-specific files 
pfmlib_power*_priv.h and into a new file - pfmlib_power_priv.h.  The 
former files now contain only a few #defines of processor-specific 
constants.

Unfortunately, this causes the patch to be quite large - about 2.7MB 
uncompressed, so I compressed it for purposes of posting it.  Even 
compressed, though, it's quite large (~180kB), and will likely be 
blocked by sourceforge until it is released from the holding area.

In addition to the above changes, there are two other small modifications:

- I discovered recently that some of the Power5 codes for perf_counters 
(a.k.a.  PCL) were incorrect.  This turned out to be due to an outdated 
Power5 events file that was being used to drive the automatic source 
code generation.  This patch fixes that problem.

- While proof-reading the dispatch function, I noticed that there's a 
memory leak.  Memory for "group_vector" is allocated but never freed.  I 
have changed the logic so that a common exit point is used, which frees 
up this memory.

Requested-by: Stephane Eranian <eran...@gmail.com>
Signed-off-by: Corey Ashford <cjash...@us.ibm.com>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to