// SPDX-License-Identifier: GPL-2.012#include "../../../util/pmu.h"3#include "../../../util/pmus.h"4#include "../../../util/tool_pmu.h"5#include <api/fs/fs.h>67u64 tool_pmu__cpu_slots_per_cycle(void)8{9char path[PATH_MAX];10unsigned long long slots = 0;11struct perf_pmu *pmu = perf_pmus__find_core_pmu();1213if (pmu) {14perf_pmu__pathname_scnprintf(path, sizeof(path),15pmu->name, "caps/slots");16/*17* The value of slots is not greater than 32 bits, but18* filename__read_int can't read value with 0x prefix,19* so use filename__read_ull instead.20*/21filename__read_ull(path, &slots);22}2324return slots;25}262728