1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_CPUTOPO_H
3 #define __PERF_CPUTOPO_H
5 #include <linux/types.h>
8 /* The number of unique package_cpus_lists below. */
9 u32 package_cpus_lists
;
10 /* The number of unique die_cpu_lists below. */
12 /* The number of unique core_cpu_lists below. */
15 * An array of strings where each string is unique and read from
16 * /sys/devices/system/cpu/cpuX/topology/package_cpus_list. From the ABI
17 * each of these is a human-readable list of CPUs sharing the same
18 * physical_package_id. The format is like 0-3, 8-11, 14,17.
20 const char **package_cpus_list
;
22 * An array of string where each string is unique and from
23 * /sys/devices/system/cpu/cpuX/topology/die_cpus_list. From the ABI
24 * each of these is a human-readable list of CPUs within the same die.
25 * The format is like 0-3, 8-11, 14,17.
27 const char **die_cpus_list
;
29 * An array of string where each string is unique and from
30 * /sys/devices/system/cpu/cpuX/topology/core_cpus_list. From the ABI
31 * each of these is a human-readable list of CPUs within the same
32 * core. The format is like 0-3, 8-11, 14,17.
34 const char **core_cpus_list
;
37 struct numa_topology_node
{
44 struct numa_topology
{
46 struct numa_topology_node nodes
[];
49 struct hybrid_topology_node
{
54 struct hybrid_topology
{
56 struct hybrid_topology_node nodes
[];
60 * The topology for online CPUs, lazily created.
62 const struct cpu_topology
*online_topology(void);
64 struct cpu_topology
*cpu_topology__new(void);
65 void cpu_topology__delete(struct cpu_topology
*tp
);
66 /* Determine from the core list whether SMT was enabled. */
67 bool cpu_topology__smt_on(const struct cpu_topology
*topology
);
68 /* Are the sets of SMT siblings all enabled or all disabled in user_requested_cpus. */
69 bool cpu_topology__core_wide(const struct cpu_topology
*topology
,
70 const char *user_requested_cpu_list
);
72 struct numa_topology
*numa_topology__new(void);
73 void numa_topology__delete(struct numa_topology
*tp
);
75 struct hybrid_topology
*hybrid_topology__new(void);
76 void hybrid_topology__delete(struct hybrid_topology
*tp
);
78 #endif /* __PERF_CPUTOPO_H */