Blame SOURCES/papi-aarch64.patch

da2d47
commit 071943b6ffb67047c78bc7e7c370fc41c16ef538
da2d47
Author: William Cohen <wcohen@redhat.com>
da2d47
Date:   Fri Oct 11 13:41:41 2013 -0400
da2d47
da2d47
    add preliminary aarch64 (arm64) support
da2d47
    
da2d47
    There has been some work to build fedora 19 on 64-bit arm armv8 machines
da2d47
    (aarch64).  I took a look that the why the papi build was failing.  The
da2d47
    attached is a set of minimal patches to get papi to build.  The patch is
da2d47
    just a step toward getting aarch64 support for papi. Things are not all
da2d47
    there for papi to work in that environment.  Still need libpfm to
da2d47
    support aarch64 and papi_events.csv describing mappings to machine
da2d47
    specific events.
da2d47
da2d47
diff --git a/src/configure b/src/configure
da2d47
index 7cbd262..3c50e20 100755
da2d47
--- a/src/configure
da2d47
+++ b/src/configure
da2d47
@@ -4262,7 +4262,7 @@ _ACEOF
da2d47
 
da2d47
 # First set pthread-mutexes based on arch
da2d47
 case $arch in
da2d47
-  arm*)
da2d47
+  aarch64|arm*)
da2d47
     pthread_mutexes=yes
da2d47
     CFLAGS="$CFLAGS -DUSE_PTHREAD_MUTEXES"
da2d47
     echo "forcing use of pthread mutexes... " >&6
da2d47
diff --git a/src/configure.in b/src/configure.in
da2d47
index 2a73ad6..acc8bfc 100644
da2d47
--- a/src/configure.in
da2d47
+++ b/src/configure.in
da2d47
@@ -382,7 +382,7 @@ AC_DEFINE_UNQUOTED(CPU,$CPU,[cpu type])
da2d47
 
da2d47
 # First set pthread-mutexes based on arch                                       
da2d47
 case $arch in
da2d47
-  arm*)
da2d47
+  aarch64|arm*)
da2d47
     pthread_mutexes=yes
da2d47
     CFLAGS="$CFLAGS -DUSE_PTHREAD_MUTEXES"
da2d47
     echo "forcing use of pthread mutexes... " >&6
da2d47
diff --git a/src/linux-context.h b/src/linux-context.h
da2d47
index 2135695..524490b 100644
da2d47
--- a/src/linux-context.h
da2d47
+++ b/src/linux-context.h
da2d47
@@ -31,6 +31,8 @@ typedef ucontext_t hwd_ucontext_t;
da2d47
 #define OVERFLOW_ADDRESS(ctx) ((struct sigcontext *)ctx.ucontext)->si_regs.pc
da2d47
 #elif defined(__arm__)
da2d47
 #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.arm_pc
da2d47
+#elif defined(__aarch64__)
da2d47
+#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc
da2d47
 #elif defined(__mips__)
da2d47
 #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc
da2d47
 #else
da2d47
diff --git a/src/linux-timer.c b/src/linux-timer.c
da2d47
index 8e2d21f..9b918cd 100644
da2d47
--- a/src/linux-timer.c
da2d47
+++ b/src/linux-timer.c
da2d47
@@ -215,7 +215,7 @@ get_cycles( void )
da2d47
 /* POWER get_cycles()   */
da2d47
 /************************/
da2d47
 
da2d47
-#elif (defined(__powerpc__) || defined(__arm__) || defined(__mips__))
da2d47
+#elif (defined(__powerpc__) || defined(__arm__) || defined(__mips__) || defined(__aarch64__))
da2d47
 /*
da2d47
  * It's not possible to read the cycles from user space on ppc970.
da2d47
  * There is a 64-bit time-base register (TBU|TBL), but its
da2d47
commit 479e89a51ee18ba331c86a41be9ff17cd501e6d9
da2d47
Author: William Cohen <wcohen@redhat.com>
da2d47
Date:   Wed May 28 17:01:41 2014 -0400
da2d47
da2d47
    Add aarch64 Cortex A57 presets
da2d47
    
da2d47
    The events for the ARM Cortex A57 events look to be the same as the
da2d47
    events for the ARM Cortex A15 events. Add an entry so the preset are
da2d47
    available for the ARM Cortex A57.
da2d47
da2d47
diff --git a/src/papi_events.csv b/src/papi_events.csv
da2d47
index 441844e..dbbc8d8 100644
da2d47
--- a/src/papi_events.csv
da2d47
+++ b/src/papi_events.csv
da2d47
@@ -1473,6 +1473,7 @@ PRESET,PAPI_L1_DCM,NOT_DERIVED,DCACHE_REFILL
da2d47
 PRESET,PAPI_L1_ICM,NOT_DERIVED,IFETCH_MISS
da2d47
 #
da2d47
 CPU,arm_ac15
da2d47
+CPU,arm_ac57
da2d47
 #
da2d47
 PRESET,PAPI_TOT_INS,NOT_DERIVED,INST_RETIRED
da2d47
 PRESET,PAPI_TOT_IIS,NOT_DERIVED,INST_SPEC_EXEC