[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oprofile-list
Subject:    Re: [PATCH] Add pseudo event for POWER7 to count rising edge events
From:       Maynard Johnson <maynardj () us ! ibm ! com>
Date:       2013-11-06 23:02:05
Message-ID: 527ACA6D.2070701 () us ! ibm ! com
[Download RAW message or body]

On 11/06/2013 03:49 PM, Carl E. Love wrote:
> On Wed, 2013-11-06 at 12:39 -0600, Maynard Johnson wrote:
>> Carl, please review this patch.
>>
>> Thanks!
>> -Maynard
>>
> 
> Maynard:
> 
> Having looked at the patch a couple of other ways of addressing the
> issue come to mind.
> 
> 1) Could we use the existing unit mask infrastructure to accomplish
> this?
> 
> Power currently doesn't use the unit mask so this could be used to
> indicate the edge detect bit needs to be set for a given event.  From a
> quick code review, it appears the code changes to do this is a little
> more involved then your current solution.  Additionally, it would also
> add overhead for something that is rarely going to be used. 
> 
> 2) Just create a new event with the bit set in the event code?
> Currently for those Power events that can be counted with and without
> the edge detect there are unique event names for them.  These events 
> are clearly documented.  To create a new event with the desired 
> event code means the new event would need to be added to LIBPFM3 and 
> LIBPFM4.  However there are other tools that use LIBPFM and now we
> would have an undocumented event in LIBPFM and would have to make sure
> all the other tools could handle this new event.  Not very appealing
> 
> 
> This seems to be the only case where Power did not specify an event and
> its edge enabled version as separate named and documented events.  Given
> that neither of the above two solutions are very appealing, the code you
> have to create a special OProfile event seems reasonable for handling 
> this one exception.  If at sometime we find that support is needed
> for a number of additional edge qualified events then I would strongly
> suggest you reconsider option 1.  
> 
> I tested the patch with the classic OProfile driver and operf.  The 
> patch worked fine for both versions of the tool.  The patch looks fine
> from a code review standpoint and is functionally acceptable assuming
> there is just one edge event that needs to be supported.
> 
>                Carl Love
Patch committed. Thanks for the review.

-Maynard
>> -------------------------------------------------------------
>> Add pseudo event for POWER7 to count rising edge events
>>
>> This patch is specific to the IBM Power architecture.
>> The patch adds the capability to detect events where the
>> "_EDGE_COUNT" suffix has been appended to a real native event
>> name. The intent of such an event is to detect the rising edge
>> of the corresponding real native event. This "edge detection"
>> technique is useful for events that normally count the number
>> of cycles that a particular condition is true.
>> Since such "pseudo events" have not been formally defined in
>> processor documentation, libpfm does not know about them; thus,
>> we must convert them to their real native event equivalent in
>> order to get the base code. We thenset the "edge detect" bit
>> (the LSB) in the event code.
>>
>> This patch adds one new POWER7 event, PM_GCT_NOSLOT_CYC_EDGE_COUNT,
>> which uses the edge detection.
>>
>> Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

[snip]


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
oprofile-list mailing list
oprofile-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic