Dan:

Perfmon2 does not support variable sized counters.  It makes the
assumption that counter size is a known, fixed size.  The implementation
for cell was fixed to four 32 bit counters per node due to the lack of
support for a variable size.  We did not choose to go with eight 16 bit
counters per node because the feeling was the overhead of having to
invoke the interrupt handler on a 16 bit counter would be very high.
Typically, a user will be measuring either cycles or instructions along
with another event.  Causing an interrupt every 2^16 cycles would be
very expensive. 

I would have to double code but does pfm_get_num_counters() return the
total number of counters in a system?  On a cell system there are two
nodes.  Each node has a performance counter unit with four 32 bit
counters.

Supporting both 16 and 32 bit counters gets very complicated.
Specifically in the code for handling 64 bit virtual counters.  We
talked about providing support at some future time but felt there were
other higher priority things to do first.  Also, the perfmon2 interface
is already complex.  This is one of the reason it is has not gotten
accepted into the kernel.  We felt adding variable sized counter support
now would only add additional complexity that would further hinder
getting it accepted.  So best to try and keep things simple for now, get
it accepted then incrementally add the complexity later.

            Carl Love


On Fri, 2008-06-06 at 15:07 -0400, Dan Terpstra wrote:
> I'm working on implementing PAPI on Cell.
> And I'm confused.
> Can someone tell me why pfm_get_num_counters() returns 8 for Cell (I think
> this is # of 16-bit counters?) when pfm_cell_get_event_code() compares
> against a hard-coded limit of 2 (see below)? Could this limit simply have
> been inappropriately inherited from another platform?
> Also, how does one distinguish between using these counters in 16-bit mode
> vs. 32-bit mode?
> - d
> 
> static int
> pfm_cell_get_event_code(unsigned int i, unsigned int cnt, int *code)
> {
>       if (cnt != PFMLIB_CNT_FIRST && cnt > 2) {
>               return PFMLIB_ERR_INVAL;
>       }
> 
>       *code = cell_pe[i].pme_code;
> 
>       return PFMLIB_SUCCESS;
> }
> 
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> perfmon2-devel mailing list
> perfmon2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perfmon2-devel


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to