Source: perftest
Version: 24.01.0+0.38-1
Tags: sid patch
Followup-For: Bug #1069808
X-Debbugs-Cc: wuruil...@loongson.cn
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear Maintainer,

I'm very sorry, I just now realized that the upstream PR link was posted 
incorrectly. the PRs have been merged as follows: 
https://github.com/linux-rdma/perftest/pull/244/files.
The attached patch has also been updated with PR, please merge the patches.

wuruilong
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 perftest (24.01.0+0.38-1) unstable; urgency=medium
 .
   * New upstream version and versioning schema (year.month).
     - Upstream man pages revised (Closes: #1054920).
   * man_page.patch: Fix syntax of man page
   * Remove maintainer man pages
   * Newer standards version: 4.6.2
Author: Tzafrir Cohen <tzaf...@debian.org>
Bug-Debian: https://bugs.debian.org/1054920

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2024-12-12

--- perftest-24.01.0+0.38.orig/src/get_clock.c
+++ perftest-24.01.0+0.38/src/get_clock.c
@@ -155,6 +155,9 @@ static double proc_get_cpu_mhz(int no_cp
                #if defined (__ia64__)
                /* Use the ITC frequency on IA64 */
                rc = sscanf(buf, "itc MHz : %lf", &m);
+                #elif defined (__loongarch__)
+               /* Use upper case cpu on LoongArch */
+               rc = sscanf(buf, "CPU MHz : %lf", &m);
                #elif defined (__PPC__) || defined (__PPC64__)
                /* PPC has a different format as well */
                rc = sscanf(buf, "clock : %lf", &m);
--- perftest-24.01.0+0.38.orig/src/get_clock.h
+++ perftest-24.01.0+0.38/src/get_clock.h
@@ -113,7 +113,16 @@ static inline cycles_t get_cycles()
 {
        return perf_get_cycles();
 }
+#elif defined(__loongarch_lp64)
 
+typedef unsigned long cycles_t;
+
+static inline cycles_t get_cycles()
+{
+        cycles_t cval;
+        __asm__ __volatile__("rdtime.d %0, $zero" : "=r"(cval));
+        return cval;
+}
 #else
 #warning get_cycles not implemented for this architecture: attempt asm/timex.h
 #include <asm/timex.h>

Reply via email to