hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/tools/perf/arch/powerpc/util/header.c
....@@ -7,15 +7,9 @@
77 #include <string.h>
88 #include <linux/stringify.h>
99 #include "header.h"
10
-#include "util.h"
11
-
12
-#define mfspr(rn) ({unsigned long rval; \
13
- asm volatile("mfspr %0," __stringify(rn) \
14
- : "=r" (rval)); rval; })
15
-
16
-#define SPRN_PVR 0x11F /* Processor Version Register */
17
-#define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */
18
-#define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF) /* Revison field */
10
+#include "utils_header.h"
11
+#include "metricgroup.h"
12
+#include <api/fs/fs.h>
1913
2014 int
2115 get_cpuid(char *buffer, size_t sz)
....@@ -45,3 +39,12 @@
4539
4640 return bufp;
4741 }
42
+
43
+int arch_get_runtimeparam(struct pmu_event *pe)
44
+{
45
+ int count;
46
+ char path[PATH_MAX] = "/devices/hv_24x7/interface/";
47
+
48
+ atoi(pe->aggr_mode) == PerChip ? strcat(path, "sockets") : strcat(path, "coresperchip");
49
+ return sysfs__read_int(path, &count) < 0 ? 1 : count;
50
+}