Re: [PATCH] CPU "IBM Power Architected Events V1" support added to the testsuite

Michael Petlan <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
On 1.8.2014 16:16, Maynard Johnson wrote:
> On 07/31/2014 01:45 PM, Michael Petlan wrote:
>> Hi,
>>
>> I've added a new entry into the testsuite's event table
>> to enable support of "IBM Power Architected Events V1"
>> CPU.
>>
>> $ cat /proc/cpuinfo
>> processor       : 0
>> cpu             : POWER8 (architected), altivec supported
>> clock           : 3425.000000MHz
>> revision        : 2.1 (pvr 004b 0201)
>>
>> timebase        : 512000000
>> platform        : pSeries
>> model           : IBM pSeries (emulated by qemu)
>> machine         : CHRP IBM pSeries (emulated by qemu)
>>
>> $ ophelp -r
>> IBM Power Architected Events V1
>>
>> Although the CPU is POWER8 family, it has different event
>> set, because it's a KVM guest.
> Hi, Michael,
> The patch itself looks fine (although I need you to re-send with a
> "Signed-off-by" line as described at http://oprofile.sourceforge.net/contribute/).
> But I'm a bit confused about your environment. As far as what I
> know, the only way "ophelp -r" (using oprofile 0.9.9) will return
> "IBM Power Architected Events V1" is if AT_PLATFORM (from aux vector)
> is "POWER7" and AT_BASE_PLATFORM is "POWER8".  But your /proc/cpuinfo
> shows "POWER8", which would imply that AT_PLATFORM is also "POWER8".
>
> Can you describe your environment in detail please, just to humor me?  :-)
>
> Thanks.
> -Maynard

Hi Maynard,

1) I am resending the patch for you.

Signed-off-by: Michael Petlan <[email protected]>

diff --git a/testsuite/lib/op_events.exp b/testsuite/lib/op_events.exp
index eac5db4..8cff5d0 100644
--- a/testsuite/lib/op_events.exp
+++ b/testsuite/lib/op_events.exp
@@ -408,6 +408,20 @@ set op_event_table(power8)                          \
  	}                                           \
      }

+set op_event_table(ibm_power_architected_v1)        \
+    {                                               \
+	{                                           \
+	    {0 CYCLES 0 500000}                     \
+	}                                           \
+	{                                           \
+	    {1 PM_INST_DISP 0 1000000}              \
+	    {1 PM_BR_TAKEN_CMPL 0 100000}         \
+	    {3 PM_BR_MPRED_CMPL 0 100000}            \
+	    {4 PM_RUN_INST_CMPL 0 500000}      \
+	    {5 PM_RUN_CYC  0 500000}           \
+	}                                           \
+    }
+
  set op_event_table(ibm_compat_v1)                   \
      {                                               \
  	{                                           \
@@ -746,6 +760,7 @@ proc select_cpu_events {cpu_name} {
  	ppc64/power8 {set type power8}
  	ppc64_POWER8 {set type power8}
  	ARM_X-Gene {set type arm8}
+	IBM_Power_Architected_Events_V1 {set type ibm_power_architected_v1}
      }

      verbose "cpu type is $type"


2) The environment...

Firstly, I have to update the cpuinfo, because the previous one was
gathered using RHEL 6 with 2.6 kernel, so it was imprecise. This is
how it looks on RHEL 7:

processor	: 0
cpu		: POWER8E (raw), altivec supported
clock		: 3425.000000MHz
revision	: 2.1 (pvr 004b 0201)

timebase	: 512000000
platform	: pSeries
model		: IBM pSeries (emulated by qemu)
machine		: CHRP IBM pSeries (emulated by qemu)

The AT PLATFORM and AT BASE PLATFORM values are both POWER8:

AT_PLATFORM:     power8
AT_BASE_PLATFORM:power8

In my opinion the reason, why 'IBM Power Architected Events V1' is
shown by ophelp, is that it is a virtual machine. I am not so sure
about that,  but it may be like that due to another abstract layer
which is between the system and HW.

Michael
>>
>> ==========================================================
>>
>> Here's the patch:
>>
>> diff --git a/testsuite/lib/op_events.exp b/testsuite/lib/op_events.exp
>> index eac5db4..8cff5d0 100644
>> --- a/testsuite/lib/op_events.exp
>> +++ b/testsuite/lib/op_events.exp
>> @@ -408,6 +408,20 @@ set op_event_table(power8)                          \
>>       }                                           \
>>       }
>>
>> +set op_event_table(ibm_power_architected_v1)        \
>> +    {                                               \
>> +    {                                           \
>> +        {0 CYCLES 0 500000}                     \
>> +    }                                           \
>> +    {                                           \
>> +        {1 PM_INST_DISP 0 1000000}              \
>> +        {1 PM_BR_TAKEN_CMPL 0 100000}         \
>> +        {3 PM_BR_MPRED_CMPL 0 100000}            \
>> +        {4 PM_RUN_INST_CMPL 0 500000}      \
>> +        {5 PM_RUN_CYC  0 500000}           \
>> +    }                                           \
>> +    }
>> +
>>   set op_event_table(ibm_compat_v1)                   \
>>       {                                               \
>>       {                                           \
>> @@ -746,6 +760,7 @@ proc select_cpu_events {cpu_name} {
>>       ppc64/power8 {set type power8}
>>       ppc64_POWER8 {set type power8}
>>       ARM_X-Gene {set type arm8}
>> +    IBM_Power_Architected_Events_V1 {set type ibm_power_architected_v1}
>>       }
>>
>>       verbose "cpu type is $type"
>>
>> ==========================================================
>>
>> The only thing I am not sure about is the PM_INST_DISP event.
>> It uses the same counter as PM_BR_TAKEN_CMPL. But it seems
>> that it works because of counter multiplexing. If anyone has
>> an idea which event should replace the PM_INST_DISP to avoid
>> the counter mismatch, feel free to fix that. But it works.
>>
>> I've attached the patch and testsuite result logs. They look
>> reasonable to me.
>>
>> Regards,
>> Michael
>>
>>
>> ------------------------------------------------------------------------------
>> Infragistics Professional
>> Build stunning WinForms apps today!
>> Reboot your WinForms applications with our WinForms controls.
>> Build a bridge from your legacy apps to the future.
>> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
>>
>>
>>
>> _______________________________________________
>> oprofile-list mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
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.