From 01573e231f18eb2d99162747186f59511f56b64d Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 08 Dec 2023 10:40:48 +0000
Subject: [PATCH] 移去rt

---
 kernel/tools/perf/arch/powerpc/util/header.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/kernel/tools/perf/arch/powerpc/util/header.c b/kernel/tools/perf/arch/powerpc/util/header.c
index e46be9e..58b2d61 100644
--- a/kernel/tools/perf/arch/powerpc/util/header.c
+++ b/kernel/tools/perf/arch/powerpc/util/header.c
@@ -7,15 +7,9 @@
 #include <string.h>
 #include <linux/stringify.h>
 #include "header.h"
-#include "util.h"
-
-#define mfspr(rn)       ({unsigned long rval; \
-			 asm volatile("mfspr %0," __stringify(rn) \
-				      : "=r" (rval)); rval; })
-
-#define SPRN_PVR        0x11F	/* Processor Version Register */
-#define PVR_VER(pvr)    (((pvr) >>  16) & 0xFFFF) /* Version field */
-#define PVR_REV(pvr)    (((pvr) >>   0) & 0xFFFF) /* Revison field */
+#include "utils_header.h"
+#include "metricgroup.h"
+#include <api/fs/fs.h>
 
 int
 get_cpuid(char *buffer, size_t sz)
@@ -45,3 +39,12 @@
 
 	return bufp;
 }
+
+int arch_get_runtimeparam(struct pmu_event *pe)
+{
+	int count;
+	char path[PATH_MAX] = "/devices/hv_24x7/interface/";
+
+	atoi(pe->aggr_mode) == PerChip ? strcat(path, "sockets") : strcat(path, "coresperchip");
+	return sysfs__read_int(path, &count) < 0 ? 1 : count;
+}

--
Gitblit v1.6.2