Re: [PATCH] Add support for IBM Power event codes longer than sizeof int

Henry May <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <OFB7FDCEDE.3A8046AF-ON87257D97.006C7E66-86257D97.006D0F38@us.ibm.com>
Henry May/Rochester/IBM@IBMUS wrote on 11/21/2014 11:02:11 AM:

> From: Henry May/Rochester/IBM@IBMUS
> To: [email protected]
> Cc: William Cohen <[email protected]>, oprofile-list <oprofile-
> [email protected]>
> Date: 11/21/2014 11:03 AM
> Subject: Re: [PATCH] Add support for IBM Power event codes longer 
> than sizeof int
> 
> 
> 
> 
> 
> 
> [email protected] wrote on 11/21/2014 09:00:00 AM:
> 
> > From: [email protected] 
> > To: Henry May/Rochester/IBM@IBMUS, [email protected] 
> > Cc: oprofile-list <[email protected]>, William 
> > Cohen <[email protected]> 
> > Date: 11/21/2014 09:00 AM 
> > Subject: Re: [PATCH] Add support for IBM Power event codes longer 
> > than sizeof int 
> > 
> > On 11/20/2014 06:37 PM, Henry May wrote:
> > > 
> > > 
> > > Henry May
> > > IBM InfoSphere Streams Performance
> > > [email protected]
> > > 720-342-8873
> > > Tie: 963-8873
> > > 
> > > 
> > > [email protected] wrote on 11/19/2014 04:51:24 PM:
> > > 
> > >> From: [email protected]
> > >> To: oprofile-list <[email protected]>, Henry May/
> > >> Rochester/IBM@IBMUS, William Cohen <[email protected]>
> > >> Date: 11/19/2014 04:51 PM
> > >> Subject: [PATCH] Add support for IBM Power event codes longer 
> > than sizeof int
> > >>
> > >> Hi, Henry,
> > >> The patch below addresses the issue you raised yesterday on the 
oprofile
> > >> list (subject "PM_L1MISS_LAT_EXC_xxx events").  At first, I looked 
into
> > >> what it would take to add general support for long event codes,but 
I soon
> > >> discovered that it would entail a change to the sample file format, 
and
> > >> I was loathe to do that just for eight events from IBM POWER8. I 
verified
> > >> that there are no other events for any architecture other than 
> these eight
> > >> that have event codes longer than an integer. So I implemented a 
bit of a
> > >> hack, using the concept of a unit mask as an event qualifier. It's 
an OK
> > >> fit, conceptually, it's just a bit hacky because no other ppc64 
events
> > >> use unit masks.  But the fix was fairly small and simple, so I 
think it's
> > >> fine.
> > >>
> > >> Please give it a test and let me know how it works for you.
> > > I tested the patch and it only works with PM_L1MISS_LAT_EXC_256. 
> > Does not work with 32, 1024, or 2048.  Currently trying another 
> > iteration of the patch.
> > Henry,
> > My apologies. The testing I did for this patch used a full event 
> > specification -- e.g, PM_L1MISS_LAT_EXC_256:0x0:1:1 -- and the patch
> > worked for all events. But I get the same results you do if I use 
> > ocount or operf with just the event name. I've found the bug in the 
> > patch and as you alluded to above, you're already testing it. So 
> > when you have your test results, please post here.
> ocount accepts all counter specifications now, but the 
> PM_L1MISS_EXC_LAT counts look bogus: 
> 
>   latency | PM_L1MISS_EXC_LAT  | PM_RC_LIFETIME_EXC 
>        32 |        25,000,000  |          6,000,000 
>       256 |        30,000,000  |            660,000 
>      1024 |        64,000,000  |             35,000 
>      2048 |        10,000,000  |              1,000 
> 
> I would have expected the pattern exhibited by RC_LIFETIME_EXC, but 
> it could be that I am misinterpreting the meaning of the counters. 
> Are the L1MISS_EXC_LAT counters counting the number of events that 
> exceed the threshold, or the number of cycles accumulated by the 
> events that exceed the threshold? 
Maynard suggested I compare the results of 
perf stat -e r67200201E6,r67200101E8,r67200301EA,r67200401EC -a sleep 10
and 
ocount -s -e 
PM_L1MISS_LAT_EXC_32,PM_L1MISS_LAT_EXC_256,PM_L1MISS_LAT_EXC_1024,PM_L1MISS_LAT_EXC_2048 
-i 10000:1
There are some differences between what I am doing and this simple test 
(notably, I specified numerous counters and I'm scaling by the % time 
counted), but I think it demonstrates that ocount is doing the right 
thing:
[root@pftul3 ~]# perf stat -e 
r67200201E6,r67200101E8,r67200301EA,r67200401EC -a sleep 10

 Performance counter stats for 'sleep 10':

        11,310,770 r67200201E6      [100.00%]
        10,444,981 r67200101E8      [100.00%]
         4,184,751 r67200301EA      [100.00%]
         1,041,813 r67200401EC  

      10.001551448 seconds time elapsed

[root@pftul3 ~]# ocount -s -e 
PM_L1MISS_LAT_EXC_32,PM_L1MISS_LAT_EXC_256,PM_L1MISS_LAT_EXC_1024,PM_L1MISS_LAT_EXC_2048 
-i 10000:1
ocount: Press Ctl-c or 'kill -SIGINT 53289' to stop counting

Current time (seconds since epoch): 1416599245
Event counts (actual) for the whole system:
        Event                          Count                    % time 
counted
        PM_L1MISS_LAT_EXC_1024         4,276,539                100.00
        PM_L1MISS_LAT_EXC_2048         1,054,995                100.00
        PM_L1MISS_LAT_EXC_256          10,348,682               100.00
        PM_L1MISS_LAT_EXC_32           11,168,651               100.00
Patch looks good.
Henry
> > 
> > -Maynard
> > >>
> > >> Thanks!
> > >> -Maynard
> > >>
> > >> 
------------------------------------------------------------------------
> > >
> > [snip]
> > 
> 
------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & 
more
> Get technology previously reserved for billion-dollar corporations, FREE
> 
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk

> _______________________________________________
> oprofile-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oprofile-list

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk

_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.