6 #define MIDR "/regs/identification/midr_el1" 8 #define MIDR_REVISION_MASK 0xf 9 #define MIDR_VARIANT_SHIFT 20 10 #define MIDR_VARIANT_MASK (0xf << MIDR_VARIANT_SHIFT) 16 const char *sysfs = sysfs__mountpoint();
22 if (!sysfs || !pmu || !pmu->
cpus)
31 for (cpu = 0; cpu < cpus->
nr; cpu++) {
32 scnprintf(path,
PATH_MAX,
"%s/devices/system/cpu/cpu%d"MIDR,
33 sysfs, cpus->
map[cpu]);
35 file = fopen(path,
"r");
37 pr_debug(
"fopen failed for file %s\n", path);
50 midr = strtoul(buf, NULL, 16);
52 scnprintf(buf,
MIDR_SIZE,
"0x%016lx", midr);
58 pr_err(
"failed to get cpuid string for PMU %s\n", pmu->
name);
void cpu_map__put(struct cpu_map *map)
#define pr_debug(fmt,...)
struct cpu_map * cpu_map__get(struct cpu_map *map)