diff --git a/SOURCES/papi-rhbz2037417.patch b/SOURCES/papi-rhbz2037417.patch new file mode 100644 index 0000000..c6341c5 --- /dev/null +++ b/SOURCES/papi-rhbz2037417.patch @@ -0,0 +1,61 @@ +commit 6964aa356fa606f320c7b871123aceb5c1f21999 +Author: Masahiko, Yamada +Date: Tue Aug 24 14:17:29 2021 +0900 + + Fix the PAPI_FUL_CCY setting for a64fx + + In a64fx, the maximum number of instruction commits is 4, so the following setting was incorrect. + PAPI_FUL_CCY=CPU_CYCLES-0INST_COMMIT-1INST_COMMIT-2INST_COMMIT-3INST_COMMIT-4INST_COMMIT + + The correct settings are:. + PAPI_FUL_CCY=CPU_CYCLES-0INST_COMMIT-1INST_COMMIT-2INST_COMMIT-3INST_COMMIT + +diff --git a/src/papi_events.csv b/src/papi_events.csv +index 4ef647959..74deb712f 100644 +--- a/src/papi_events.csv ++++ b/src/papi_events.csv +@@ -1934,7 +1934,7 @@ PRESET,PAPI_PRF_DM,DERIVED_SUB,L2D_CACHE_REFILL_PRF,L2D_CACHE_MIBMCH_PRF + PRESET,PAPI_MEM_SCY,NOT_DERIVED,LD_COMP_WAIT_L2_MISS + PRESET,PAPI_STL_ICY,DERIVED_ADD,STALL_FRONTEND,STALL_BACKEND + PRESET,PAPI_STL_CCY,NOT_DERIVED,0INST_COMMIT +-PRESET,PAPI_FUL_CCY,DERIVED_SUB,CPU_CYCLES,0INST_COMMIT,1INST_COMMIT,2INST_COMMIT,3INST_COMMIT,4INST_COMMIT ++PRESET,PAPI_FUL_CCY,DERIVED_SUB,CPU_CYCLES,0INST_COMMIT,1INST_COMMIT,2INST_COMMIT,3INST_COMMIT + PRESET,PAPI_HW_INT,DERIVED_ADD,EXC_IRQ,EXC_FIQ + PRESET,PAPI_BR_MSP,NOT_DERIVED,BR_MIS_PRED + PRESET,PAPI_BR_PRC,DERIVED_SUB,BR_PRED,BR_MIS_PRED +commit fbf3b9e3d17c4ec4bd7e33410c44fc5aed57e36f +Author: Masahiko, Yamada +Date: Fri Mar 4 15:41:30 2022 +0900 + + Add PAPI idle-related preset events for a64fx + + For a64fx, add four PAPI idle-related preset events + (PAPI_BRU_IDL/PAPI_FXU_IDL/PAPI_FPU_IDL/PAPI_LSU_IDL). + + PAPI_BRU_IDL = BR_COMP_WAIT + PAPI_FXU_IDL = EU_COMP_WAIT - FL_COMP_WAIT + PAPI_FPU_IDL = FL_COMP_WAIT + PAPI_LSU_IDL = LD_COMP_WAIT + + The specifications of BR_COMP_WAIT, EU_COMP_WAIT, FL_COMP_WAIT, + and LD_COMP_WAIT can be found in the "14.4. Cycle Accounting" + on A64FX_Microarchitecture_Manual_en_1.5.pdf at the following URL:. + https://github.com/fujitsu/A64FX/blob/master/doc + + Signed-off-by: Masahiko, Yamada + +diff --git a/src/papi_events.csv b/src/papi_events.csv +index 74deb712f..1cd498e91 100644 +--- a/src/papi_events.csv ++++ b/src/papi_events.csv +@@ -1935,6 +1935,10 @@ PRESET,PAPI_MEM_SCY,NOT_DERIVED,LD_COMP_WAIT_L2_MISS + PRESET,PAPI_STL_ICY,DERIVED_ADD,STALL_FRONTEND,STALL_BACKEND + PRESET,PAPI_STL_CCY,NOT_DERIVED,0INST_COMMIT + PRESET,PAPI_FUL_CCY,DERIVED_SUB,CPU_CYCLES,0INST_COMMIT,1INST_COMMIT,2INST_COMMIT,3INST_COMMIT ++PRESET,PAPI_BRU_IDL,NOT_DERIVED,BR_COMP_WAIT ++PRESET,PAPI_FXU_IDL,DERIVED_SUB,EU_COMP_WAIT,FL_COMP_WAIT ++PRESET,PAPI_FPU_IDL,NOT_DERIVED,FL_COMP_WAIT ++PRESET,PAPI_LSU_IDL,NOT_DERIVED,LD_COMP_WAIT + PRESET,PAPI_HW_INT,DERIVED_ADD,EXC_IRQ,EXC_FIQ + PRESET,PAPI_BR_MSP,NOT_DERIVED,BR_MIS_PRED + PRESET,PAPI_BR_PRC,DERIVED_SUB,BR_PRED,BR_MIS_PRED diff --git a/SOURCES/papi-rhbz2037426.patch b/SOURCES/papi-rhbz2037426.patch new file mode 100644 index 0000000..ed03cb3 --- /dev/null +++ b/SOURCES/papi-rhbz2037426.patch @@ -0,0 +1,42 @@ +commit b78d7665bc02a0ce17adc6c09ab052064a940937 +Author: Masahiko, Yamada +Date: Wed Dec 8 19:39:44 2021 +0900 + + Improve the papi_xml_event_info command. + + Modify the papi_xml_event_info command as follows:. + - Test only the event name even if the event has a unit mask. + - Test other unit masks in the event even if + there is an error in one unit mask in the event. + + Signed-off-by: Masahiko, Yamada + +diff --git a/src/utils/papi_xml_event_info.c b/src/utils/papi_xml_event_info.c +index 2a777a9fe..c024cc036 100644 +--- a/src/utils/papi_xml_event_info.c ++++ b/src/utils/papi_xml_event_info.c +@@ -226,9 +226,6 @@ enum_native_events( FILE * f, int cidx) + k = i; + if ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_UMASKS, cidx ) == PAPI_OK ) { + +- /* Test if event can be added */ +- if ( test_event( k ) == PAPI_OK ) { +- + /* add the event */ + xmlize_event( f, &info, num ); + +@@ -237,13 +234,12 @@ enum_native_events( FILE * f, int cidx) + retval = PAPI_get_event_info( k, &info ); + if ( retval == PAPI_OK ) { + if ( test_event( k )!=PAPI_OK ) { +- break; ++ continue; + } + xmlize_event( f, &info, -1 ); + } + } while ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_UMASKS, cidx ) == PAPI_OK); + fprintf( f, " \n" ); +- } + } else { + /* this event has no unit masks; test & write the event */ + if ( test_event( i ) == PAPI_OK ) { diff --git a/SOURCES/papi-rhbz2037427.patch b/SOURCES/papi-rhbz2037427.patch new file mode 100644 index 0000000..3213976 --- /dev/null +++ b/SOURCES/papi-rhbz2037427.patch @@ -0,0 +1,140 @@ +commit 2098e8656156084104ab8d1981b53c50d22b8f62 +Author: Masahiko, Yamada +Date: Fri Mar 4 13:34:20 2022 +0900 + + PAPI_get_hardware_info: improve PAPI_hw_info_t for ARM processors + + Currently, it is not possible to determine which company the ARM processor + was designed by from the PAPI_hw_info_t available in PAPI_get_hardware_info(). + On ARM processors, the PAPI_hw_info_t obtained with PAPI_get_hardware_info() + does not contain information indicating which company was designed. + For ARM processors, improve the vendor and vendor_string entries + in PAPI_hw_info_t, which can be retrieved with PAPI_get_hardware_info(), + to include information indicating which company was designed. + + Signed-off-by: Masahiko, Yamada + +diff --git a/src/components/perf_event/pe_libpfm4_events.c b/src/components/perf_event/pe_libpfm4_events.c +index 744851ff0..6dcb5e023 100644 +--- a/src/components/perf_event/pe_libpfm4_events.c ++++ b/src/components/perf_event/pe_libpfm4_events.c +@@ -1248,8 +1248,10 @@ _pe_libpfm4_init(papi_vector_t *component, int cidx, + &pinfo,sizeof(pfm_pmu_info_t)); + found_default++; + } ++ ++ /* For ARM processors, */ + if ( (pinfo.type==PFM_PMU_TYPE_CORE) && +- ( _papi_hwi_system_info.hw_info.vendor == PAPI_VENDOR_ARM)) { ++ ( _papi_hwi_system_info.hw_info.vendor >= PAPI_VENDOR_ARM_ARM)) { + if (strlen(_papi_hwi_system_info.hw_info.model_string) == 0) { + strSize = sizeof(_papi_hwi_system_info.hw_info.model_string); + strncpy( _papi_hwi_system_info.hw_info.model_string, pinfo.desc, strSize - 1); +diff --git a/src/components/perf_event/perf_event.c b/src/components/perf_event/perf_event.c +index a50194cf6..6985fc4cb 100644 +--- a/src/components/perf_event/perf_event.c ++++ b/src/components/perf_event/perf_event.c +@@ -137,7 +137,8 @@ pe_vendor_fixups(papi_vector_t *vector) + } + + /* ARM */ +- if ( _papi_hwi_system_info.hw_info.vendor == PAPI_VENDOR_ARM) { ++ /* If implementer is ARM Limited. */ ++ if ( _papi_hwi_system_info.hw_info.vendor == PAPI_VENDOR_ARM_ARM) { + + /* Some ARMv7 and earlier could not measure */ + /* KERNEL and USER separately. */ +diff --git a/src/linux-common.c b/src/linux-common.c +index 99601db86..2527981ad 100644 +--- a/src/linux-common.c ++++ b/src/linux-common.c +@@ -112,8 +112,20 @@ decode_vendor_string( char *s, int *vendor ) + *vendor = PAPI_VENDOR_IBM; + else if ( strcasecmp( s, "Cray" ) == 0 ) + *vendor = PAPI_VENDOR_CRAY; +- else if ( strcasecmp( s, "ARM" ) == 0 ) +- *vendor = PAPI_VENDOR_ARM; ++ else if ( strcasecmp( s, "ARM_ARM" ) == 0 ) ++ *vendor = PAPI_VENDOR_ARM_ARM; ++ else if ( strcasecmp( s, "ARM_BROADCOM" ) == 0 ) ++ *vendor = PAPI_VENDOR_ARM_BROADCOM; ++ else if ( strcasecmp( s, "ARM_CAVIUM" ) == 0 ) ++ *vendor = PAPI_VENDOR_ARM_CAVIUM; ++ else if ( strcasecmp( s, "ARM_FUJITSU" ) == 0 ) ++ *vendor = PAPI_VENDOR_ARM_FUJITSU; ++ else if ( strcasecmp( s, "ARM_HISILICON") == 0 ) ++ *vendor = PAPI_VENDOR_ARM_HISILICON; ++ else if ( strcasecmp( s, "ARM_APM" ) == 0 ) ++ *vendor = PAPI_VENDOR_ARM_APM; ++ else if ( strcasecmp( s, "ARM_QUALCOMM" ) == 0 ) ++ *vendor = PAPI_VENDOR_ARM_QUALCOMM; + else if ( strcasecmp( s, "MIPS" ) == 0 ) + *vendor = PAPI_VENDOR_MIPS; + else if ( strcasecmp( s, "SiCortex" ) == 0 ) +@@ -409,9 +421,38 @@ _linux_get_cpu_info( PAPI_hw_info_t *hwinfo, int *cpuinfo_mhz ) + } + else { + /* "CPU implementer" indicates ARM */ ++ /* For ARM processors, hwinfo->vendor >= PAPI_VENDOR_ARM_ARM(0x41). */ ++ /* If implementer is ARM Limited., hwinfo->vendor == PAPI_VENDOR_ARM_ARM. */ ++ /* If implementer is Cavium Inc., hwinfo->vendor == PAPI_VENDOR_ARM_CAVIUM(0x43). */ + s = search_cpu_info( f, "CPU implementer"); + if ( s ) { +- strcpy( hwinfo->vendor_string, "ARM" ); ++ int tmp; ++ sscanf( s, "%x", &tmp ); ++ switch( tmp ) { ++ case PAPI_VENDOR_ARM_ARM: ++ strcpy( hwinfo->vendor_string, "ARM_ARM" ); ++ break; ++ case PAPI_VENDOR_ARM_BROADCOM: ++ strcpy( hwinfo->vendor_string, "ARM_BROADCOM" ); ++ break; ++ case PAPI_VENDOR_ARM_CAVIUM: ++ strcpy( hwinfo->vendor_string, "ARM_CAVIUM" ); ++ break; ++ case PAPI_VENDOR_ARM_FUJITSU: ++ strcpy( hwinfo->vendor_string, "ARM_FUJITSU" ); ++ break; ++ case PAPI_VENDOR_ARM_HISILICON: ++ strcpy( hwinfo->vendor_string, "ARM_HISILICON" ); ++ break; ++ case PAPI_VENDOR_ARM_APM: ++ strcpy( hwinfo->vendor_string, "ARM_APM" ); ++ break; ++ case PAPI_VENDOR_ARM_QUALCOMM: ++ strcpy( hwinfo->vendor_string, "ARM_QUALCOMM" ); ++ break; ++ default: ++ strcpy( hwinfo->vendor_string, "ARM_UNKNOWN" ); ++ } + } + } + } +@@ -438,7 +479,7 @@ _linux_get_cpu_info( PAPI_hw_info_t *hwinfo, int *cpuinfo_mhz ) + decode_cpuinfo_power(f,hwinfo); + } + +- if (hwinfo->vendor==PAPI_VENDOR_ARM) { ++ if (hwinfo->vendor>=PAPI_VENDOR_ARM_ARM) { + + decode_cpuinfo_arm(f,hwinfo); + } +diff --git a/src/papi.h b/src/papi.h +index 14b05da1f..b05b368cb 100644 +--- a/src/papi.h ++++ b/src/papi.h +@@ -354,6 +354,13 @@ All of the functions in the PerfAPI should use the following set of constants. + #define PAPI_VENDOR_FREESCALE 6 + #define PAPI_VENDOR_ARM 7 + #define PAPI_VENDOR_MIPS 8 ++#define PAPI_VENDOR_ARM_ARM 0x41 ++#define PAPI_VENDOR_ARM_BROADCOM 0x42 ++#define PAPI_VENDOR_ARM_CAVIUM 0x43 ++#define PAPI_VENDOR_ARM_FUJITSU 0x46 ++#define PAPI_VENDOR_ARM_HISILICON 0x48 ++#define PAPI_VENDOR_ARM_APM 0x50 ++#define PAPI_VENDOR_ARM_QUALCOMM 0x51 + /** @} */ + + /** @internal diff --git a/SPECS/papi.spec b/SPECS/papi.spec index 0602c4e..02a4c9e 100644 --- a/SPECS/papi.spec +++ b/SPECS/papi.spec @@ -8,7 +8,7 @@ Summary: Performance Application Programming Interface Name: papi Version: 5.6.0 -Release: 14%{?dist} +Release: 15%{?dist} License: BSD Group: Development/System Requires: papi-libs = %{version}-%{release} @@ -21,6 +21,9 @@ Patch4: papi-thread_init.patch Patch5: papi-mx.patch Patch6: papi-bz1908126.patch Patch7: papi-rhbz1918721.patch +Patch8: papi-rhbz2037417.patch +Patch9: papi-rhbz2037426.patch +Patch10: papi-rhbz2037427.patch BuildRequires: autoconf BuildRequires: doxygen BuildRequires: ncurses-devel @@ -91,6 +94,9 @@ the PAPI user-space libraries and interfaces. %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build %if %{without bundled_libpfm} @@ -173,6 +179,9 @@ chrpath --delete $RPM_BUILD_ROOT%{_libdir}/*.so* %{_libdir}/*.a %changelog +* Tue Apr 19 2022 William Cohen - 5.6.0-15 +- Fujitsu A64FX improvements. (rhbz2037417,rhbz2037426,rhbz2037427) + * Tue May 25 2021 William Cohen - 5.6.0-14 - Disable problematic IBM Power9 events.