Discussion:
[PATCH] 1/2 Oprofile support for Power9
(too old to reply)
Will Schmidt
2017-06-06 15:52:00 UTC
Permalink
Raw Message
Hi,

Add initial support for PPC64/Power9 to oprofile.
This includes the documentation updates to indicate "power9",
the PVR values, and all the other updates that will be necessary.
(This is based on a review of changes made when Power8 support
was initially added).
The long-ish event list follows as a subsequent patch.

Signed-off-by: Will Schmidt <***@vnet.ibm.com>

--


diff --git a/doc/oprofile.xml b/doc/oprofile.xml
index 325ef6f..01930ab 100644
--- a/doc/oprofile.xml
+++ b/doc/oprofile.xml
@@ -486,7 +486,7 @@ can be used for <command>ocount</command>, minus the <emphasis>count</emphasis>
<row><entry>Hammer</entry><entry>x86-64/hammer</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
<row><entry>Family10h</entry><entry>x86-64/family10</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
<row><entry>Family11h</entry><entry>x86-64/family11h</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
-<row><entry>IBM pseries</entry><entry>ppc64/power{ 4|5|6|7|8|970 }</entry><entry>CYCLES:100000:0:1:1</entry></row>
+<row><entry>IBM pseries</entry><entry>ppc64/power{ 4|5|6|7|8|9|970 }</entry><entry>CYCLES:100000:0:1:1</entry></row>
<row><entry>IBM s390</entry><entry>s390/{ z10|z196|zEC12 }</entry><entry>HWSAMPLING:4127518:0:1:1</entry></row>
</tbody>
</tgroup>
diff --git a/events/Makefile.am b/events/Makefile.am
index db43550..b8f06af 100644
--- a/events/Makefile.am
+++ b/events/Makefile.am
@@ -29,6 +29,7 @@ event_files = \
ppc64/power6/events ppc64/power6/event_mappings ppc64/power6/unit_masks \
ppc64/power7/events ppc64/power7/event_mappings ppc64/power7/unit_masks \
ppc64/power8/events ppc64/power8/unit_masks \
+ ppc64/power9/events ppc64/power9/unit_masks \
ppc64/970/events ppc64/970/event_mappings ppc64/970/unit_masks \
ppc64/970MP/events ppc64/970MP/event_mappings ppc64/970MP/unit_masks \
x86-64/hammer/events x86-64/hammer/unit_masks \
diff --git a/events/ppc64/power9/events b/events/ppc64/power9/events
new file mode 100644
index 0000000..a2071e7
--- /dev/null
+++ b/events/ppc64/power9/events
@@ -0,0 +1,8 @@
+
+# Copyright OProfile authors
+# Copyright (c) International Business Machines, 2017.
+# Contributed by Will Schmidt <***@vnet.ibm.com>.
+#
+# IBM POWER9 Events
+
+include:ppc64/architected_events_v1
diff --git a/events/ppc64/power9/unit_masks b/events/ppc64/power9/unit_masks
new file mode 100644
index 0000000..e384695
--- /dev/null
+++ b/events/ppc64/power9/unit_masks
@@ -0,0 +1,9 @@
+#
+# Copyright OProfile authors
+# Copyright (c) International Business Machines, 2017.
+# Contributed by Will Schmidt <***@vnet.ibm.com>
+#
+# ppc64 POWER9 possible unit masks
+#
+name:zero type:mandatory default:0x0
+ 0x0 No unit mask
diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c
index 3d3c9c8..7acecda 100644
--- a/libop/op_cpu_type.c
+++ b/libop/op_cpu_type.c
@@ -119,6 +119,7 @@ static struct cpu_descr const cpu_descrs[MAX_CPU_TYPE] = {
{ "Intel Goldmont microarchitecture", "i386/goldmont", CPU_GOLDMONT, 4 },
{ "IBM z13", "s390/z13", CPU_S390_Z13, 1 },
{ "ARM Cortex-A17", "arm/armv7-ca17", CPU_ARM_V7_CA17, 7 },
+ { "ppc64 POWER9", "ppc64/power9", CPU_PPC64_POWER9, 6 },
};

static size_t const nr_cpu_descrs = sizeof(cpu_descrs) / sizeof(struct cpu_descr);
@@ -292,6 +293,8 @@ static op_cpu _try_ppc64_arch_generic_cpu(void)
*/
if ((strcmp(platform, "power7") == 0) && (strcmp(base_platform, "power8") == 0))
cpu_type = CPU_PPC64_POWER8;
+ else if ((strcmp(platform, "power8") == 0) && (strcmp(base_platform, "power9") == 0))
+ cpu_type = CPU_PPC64_POWER9;
else
cpu_type = CPU_PPC64_ARCH_V1;
}
diff --git a/libop/op_cpu_type.h b/libop/op_cpu_type.h
index 78eb9bc..39b7726 100644
--- a/libop/op_cpu_type.h
+++ b/libop/op_cpu_type.h
@@ -105,6 +105,7 @@ typedef enum {
CPU_GOLDMONT, /** < Intel Goldmont microarchitecture */
CPU_S390_Z13, /** < IBM z13 */
CPU_ARM_V7_CA17, /* ARM Cortex-A17 */
+ CPU_PPC64_POWER9, /**< ppc64 POWER8 family */
MAX_CPU_TYPE
} op_cpu;

diff --git a/libop/op_events.c b/libop/op_events.c
index 0c7e9bc..0ba57e0 100644
--- a/libop/op_events.c
+++ b/libop/op_events.c
@@ -1259,6 +1259,7 @@ void op_default_event(op_cpu cpu_type, struct op_default_event_descr * descr)
case CPU_PPC64_POWER7:
case CPU_PPC64_ARCH_V1:
case CPU_PPC64_POWER8:
+ case CPU_PPC64_POWER9:
descr->name = "CYCLES";
break;

diff --git a/utils/ophelp.c b/utils/ophelp.c
index ff4e3f1..6eb299c 100644
--- a/utils/ophelp.c
+++ b/utils/ophelp.c
@@ -680,6 +680,12 @@ int main(int argc, char const * argv[])
"See Power ISA 2.07 at https://www.power.org/\n\n";
break;

+ case CPU_PPC64_POWER9:
+ event_doc =
+ "This processor type is fully supported with operf.\n"
+ "See Power ISA 3.0 at https://www.power.org/\n\n";
+ break;
+
case CPU_MIPS_20K:
event_doc =
"See Programming the MIPS64 20Kc Processor Core User's "
William Cohen
2017-06-07 17:17:45 UTC
Permalink
Raw Message
Post by Will Schmidt
Hi,
Add initial support for PPC64/Power9 to oprofile.
This includes the documentation updates to indicate "power9",
the PVR values, and all the other updates that will be necessary.
(This is based on a review of changes made when Power8 support
was initially added).
The long-ish event list follows as a subsequent patch.
--
Hi Will,

I have started to review the power9 patches. IIRC OProfile uses libpfm for some of the event mapping for power processors. Is that the case for power9 also? Are there similar power9 patches coming for libpfm?

-Will
Will Schmidt
2017-06-07 18:51:57 UTC
Permalink
Raw Message
Post by William Cohen
Post by Will Schmidt
Hi,
Add initial support for PPC64/Power9 to oprofile.
This includes the documentation updates to indicate "power9",
the PVR values, and all the other updates that will be necessary.
(This is based on a review of changes made when Power8 support
was initially added).
The long-ish event list follows as a subsequent patch.
--
Hi Will,
I have started to review the power9 patches. IIRC OProfile uses libpfm
for some of the event mapping for power processors. Is that the case
for power9 also? Are there similar power9 patches coming for libpfm?
Yes. They've been sent (yesterday), and I believe are now in the
moderator queue awaiting approval, due to their size.
Post by William Cohen
-Will
William Cohen
2017-06-08 13:45:27 UTC
Permalink
Raw Message
Post by Will Schmidt
Post by William Cohen
Post by Will Schmidt
Hi,
Add initial support for PPC64/Power9 to oprofile.
This includes the documentation updates to indicate "power9",
the PVR values, and all the other updates that will be necessary.
(This is based on a review of changes made when Power8 support
was initially added).
The long-ish event list follows as a subsequent patch.
--
Hi Will,
I have started to review the power9 patches. IIRC OProfile uses libpfm
for some of the event mapping for power processors. Is that the case
for power9 also? Are there similar power9 patches coming for libpfm?
Yes. They've been sent (yesterday), and I believe are now in the
moderator queue awaiting approval, due to their size.
Post by William Cohen
-Will
Hi Will,

The patches looked reasonable, so they have been checked into the main oprofile git repository. Thanks for the patches.

Do you have some patches to add to the oprofile-testsuite to allow testing oprofile on power9?

-Will
Will Schmidt
2017-06-08 15:53:44 UTC
Permalink
Raw Message
Post by William Cohen
Post by Will Schmidt
Post by William Cohen
Post by Will Schmidt
Hi,
Add initial support for PPC64/Power9 to oprofile.
This includes the documentation updates to indicate "power9",
the PVR values, and all the other updates that will be necessary.
(This is based on a review of changes made when Power8 support
was initially added).
The long-ish event list follows as a subsequent patch.
--
Hi Will,
I have started to review the power9 patches. IIRC OProfile uses libpfm
for some of the event mapping for power processors. Is that the case
for power9 also? Are there similar power9 patches coming for libpfm?
Yes. They've been sent (yesterday), and I believe are now in the
moderator queue awaiting approval, due to their size.
Post by William Cohen
-Will
Hi Will,
The patches looked reasonable, so they have been checked into the main oprofile git repository. Thanks for the patches.
Do you have some patches to add to the oprofile-testsuite to allow testing oprofile on power9?
I had spaced this part, my bad. Thanks for the reminder... :-)

Patch to add p9 to the testsuite will be following momentarily.
Post by William Cohen
-Will
William Cohen
2017-06-07 18:56:53 UTC
Permalink
Raw Message
Post by Will Schmidt
Hi,
Add initial support for PPC64/Power9 to oprofile.
This includes the documentation updates to indicate "power9",
the PVR values, and all the other updates that will be necessary.
(This is based on a review of changes made when Power8 support
was initially added).
The long-ish event list follows as a subsequent patch.
--
The patches apply cleanly and build fine.
Post by Will Schmidt
diff --git a/utils/ophelp.c b/utils/ophelp.c
index ff4e3f1..6eb299c 100644
--- a/utils/ophelp.c
+++ b/utils/ophelp.c
@@ -680,6 +680,12 @@ int main(int argc, char const * argv[])
"See Power ISA 2.07 at https://www.power.org/\n\n";
break;
+ event_doc =
+ "This processor type is fully supported with operf.\n"
+ "See Power ISA 3.0 at https://www.power.org/\n\n";
+ break;
https://www.power.org/ seems to be unreachable. It that site still the correct site for this information?

-Will
Post by Will Schmidt
+
event_doc =
"See Programming the MIPS64 20Kc Processor Core User's "
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
oprofile-list mailing list
https://lists.sourceforge.net/lists/listinfo/oprofile-list
Will Schmidt
2017-06-07 19:30:28 UTC
Permalink
Raw Message
Post by William Cohen
Post by Will Schmidt
Hi,
+ event_doc =
+ "This processor type is fully supported with operf.\n"
+ "See Power ISA 3.0 at https://www.power.org/\n\n";
+ break;
https://www.power.org/ seems to be unreachable. It that site still the correct site for this information?
-Will
Hmm, same thing for me here. I'm not sure what is going on with
power.org. I'll have to get back to you on this one.

-Will
Will Schmidt
2017-06-09 19:29:34 UTC
Permalink
Raw Message
Post by Will Schmidt
Post by William Cohen
Post by Will Schmidt
Hi,
+ event_doc =
+ "This processor type is fully supported with operf.\n"
+ "See Power ISA 3.0 at https://www.power.org/\n\n";
+ break;
https://www.power.org/ seems to be unreachable. It that site still the correct site for this information?
-Will
Hmm, same thing for me here. I'm not sure what is going on with
power.org. I'll have to get back to you on this one.
The power.org references are no longer valid.
Openpowerfoundation.org is the current home for the P8 and newer
documents.
I'll have an update for the power8/power9 references from ophelp posted
here momentarily.

Thanks,
-Will
Post by Will Schmidt
-Will
Loading...