xref: /linux/tools/perf/util/cputopo.h (revision 8137a49e1567726eb10fcf55ad141ac19804ca6b)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_CPUTOPO_H
3 #define __PERF_CPUTOPO_H
4 
5 #include <linux/types.h>
6 
7 struct cpu_topology {
8 	u32	  core_sib;
9 	u32	  die_sib;
10 	u32	  thread_sib;
11 	char	**core_siblings;
12 	char	**die_siblings;
13 	char	**thread_siblings;
14 };
15 
16 struct numa_topology_node {
17 	char		*cpus;
18 	u32		 node;
19 	u64		 mem_total;
20 	u64		 mem_free;
21 };
22 
23 struct numa_topology {
24 	u32				nr;
25 	struct numa_topology_node	nodes[];
26 };
27 
28 struct hybrid_topology_node {
29 	char		*pmu_name;
30 	char		*cpus;
31 };
32 
33 struct hybrid_topology {
34 	u32				nr;
35 	struct hybrid_topology_node	nodes[];
36 };
37 
38 struct cpu_topology *cpu_topology__new(void);
39 void cpu_topology__delete(struct cpu_topology *tp);
40 
41 struct numa_topology *numa_topology__new(void);
42 void numa_topology__delete(struct numa_topology *tp);
43 
44 struct hybrid_topology *hybrid_topology__new(void);
45 void hybrid_topology__delete(struct hybrid_topology *tp);
46 
47 #endif /* __PERF_CPUTOPO_H */
48