diff --git a/add-sw_64-support.patch b/add-sw_64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..12b4be5eac087dd077c2869d742346477150ca33 --- /dev/null +++ b/add-sw_64-support.patch @@ -0,0 +1,67 @@ +From 8276282cf1e6d7629df01d0024d39b851ba29b29 Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 11 Nov 2024 15:59:21 +0800 +Subject: [PATCH] add sw64 support + +--- + src/linux-context.h | 2 ++ + src/linux-timer.c | 15 +++++++++++++++ + src/mb.h | 3 +++ + 3 files changed, 20 insertions(+) + +diff --git a/src/linux-context.h b/src/linux-context.h +index 00ebf73..f87e14e 100644 +--- a/src/linux-context.h ++++ b/src/linux-context.h +@@ -35,6 +35,8 @@ typedef ucontext_t hwd_ucontext_t; + #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.arm_pc + #elif defined(__aarch64__) + #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc ++#elif defined(__sw_64__) ++#define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.sc_pc + #elif defined(__mips__) + #define OVERFLOW_ADDRESS(ctx) ctx.ucontext->uc_mcontext.pc + #elif defined(__hppa__) +diff --git a/src/linux-timer.c b/src/linux-timer.c +index 666801f..5515f57 100644 +--- a/src/linux-timer.c ++++ b/src/linux-timer.c +@@ -230,6 +230,21 @@ get_cycles( void ) + return ret; + } + ++/************************/ ++/* sw_64 get_cycles() */ ++/************************/ ++ ++#elif defined(__sw_64__) ++static inline long long ++get_cycles( void ) ++{ ++ register unsigned long ret; ++ ++ __asm__ __volatile__ ("rtc %0" : "=r" (ret)); ++ ++ return ret; ++} ++ + /************************/ + /* aarch64 get_cycles() */ + /************************/ +diff --git a/src/mb.h b/src/mb.h +index 03e910b..74a3871 100644 +--- a/src/mb.h ++++ b/src/mb.h +@@ -26,6 +26,9 @@ + #elif defined (__alpha__) + #define rmb() asm volatile("mb" ::: "memory") + ++#elif defined (__sw_64__) ++#define rmb() asm volatile("memb" ::: "memory") ++ + #elif defined(__ia64__) + #define rmb() asm volatile ("mf" ::: "memory") + +-- +2.33.0 + diff --git a/papi.spec b/papi.spec index 9b818aad858a744b3d27ada3cdb5443303df4760..c6b753a5bc69361fef9495f15cfdb8856a50a88f 100644 --- a/papi.spec +++ b/papi.spec @@ -1,6 +1,6 @@ Name: papi Version: 7.1.0 -Release: 3 +Release: 4 Summary: Performance Application Programming Interface License: BSD-3-clause URL: http://icl.cs.utk.edu/papi/ @@ -14,6 +14,7 @@ Obsoletes: papi-libs < %{version}-%{release} Patch0001: papi-add-support-riscv64.patch Patch0002: add-loongarch64-support-for-papi.patch +Patch0003: add-sw_64-support.patch %description PAPI provides a programmer interface to monitor the performance of @@ -44,7 +45,11 @@ cd src autoconf %configure --with-perf-events --with-pfm-incdir=%{_includedir} --with-pfm-libdir=%{_libdir} \ --with-static-lib=yes --with-shared-lib=yes --with-shlib --with-shlib-tools \ +%ifarch sw_64 +--with-components="coretemp example infiniband lmsensors lustre micpower mx net rapl stealtime" +%else --with-components="appio coretemp example infiniband lmsensors lustre micpower mx net rapl stealtime" +%endif DBG="" make %{?_smp_mflags} @@ -90,6 +95,9 @@ done %{_mandir}/man3/* %changelog +* Tue Feb 25 2025 zhangshaoning - 7.1.0-4 +- Add sw_64 support + * Tue Jan 07 2025 Wenlong Zhang - 7.1.0-3 - add loongarch64 support for papi