Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __PERF_CPUTOPO_H
0003 #define __PERF_CPUTOPO_H
0004 
0005 #include <linux/types.h>
0006 
0007 struct cpu_topology {
0008     /* The number of unique package_cpus_lists below. */
0009     u32   package_cpus_lists;
0010     /* The number of unique die_cpu_lists below. */
0011     u32   die_cpus_lists;
0012     /* The number of unique core_cpu_lists below. */
0013     u32   core_cpus_lists;
0014     /*
0015      * An array of strings where each string is unique and read from
0016      * /sys/devices/system/cpu/cpuX/topology/package_cpus_list. From the ABI
0017      * each of these is a human-readable list of CPUs sharing the same
0018      * physical_package_id. The format is like 0-3, 8-11, 14,17.
0019      */
0020     const char **package_cpus_list;
0021     /*
0022      * An array of string where each string is unique and from
0023      * /sys/devices/system/cpu/cpuX/topology/die_cpus_list. From the ABI
0024      * each of these is a human-readable list of CPUs within the same die.
0025      * The format is like 0-3, 8-11, 14,17.
0026      */
0027     const char **die_cpus_list;
0028     /*
0029      * An array of string where each string is unique and from
0030      * /sys/devices/system/cpu/cpuX/topology/core_cpus_list. From the ABI
0031      * each of these is a human-readable list of CPUs within the same
0032      * core. The format is like 0-3, 8-11, 14,17.
0033      */
0034     const char **core_cpus_list;
0035 };
0036 
0037 struct numa_topology_node {
0038     char        *cpus;
0039     u32      node;
0040     u64      mem_total;
0041     u64      mem_free;
0042 };
0043 
0044 struct numa_topology {
0045     u32             nr;
0046     struct numa_topology_node   nodes[];
0047 };
0048 
0049 struct hybrid_topology_node {
0050     char        *pmu_name;
0051     char        *cpus;
0052 };
0053 
0054 struct hybrid_topology {
0055     u32             nr;
0056     struct hybrid_topology_node nodes[];
0057 };
0058 
0059 struct cpu_topology *cpu_topology__new(void);
0060 void cpu_topology__delete(struct cpu_topology *tp);
0061 
0062 struct numa_topology *numa_topology__new(void);
0063 void numa_topology__delete(struct numa_topology *tp);
0064 
0065 struct hybrid_topology *hybrid_topology__new(void);
0066 void hybrid_topology__delete(struct hybrid_topology *tp);
0067 
0068 #endif /* __PERF_CPUTOPO_H */