.. | .. |
---|
7 | 7 | #include <string.h> |
---|
8 | 8 | #include <linux/stringify.h> |
---|
9 | 9 | #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> |
---|
19 | 13 | |
---|
20 | 14 | int |
---|
21 | 15 | get_cpuid(char *buffer, size_t sz) |
---|
.. | .. |
---|
45 | 39 | |
---|
46 | 40 | return bufp; |
---|
47 | 41 | } |
---|
| 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 | +} |
---|