Commit | Line | Data |
---|---|---|
f0ce888c ACM |
1 | #ifndef __PERF_ENV_H |
2 | #define __PERF_ENV_H | |
3 | ||
720e98b5 | 4 | #include <linux/types.h> |
c60da22a | 5 | #include "cpumap.h" |
720e98b5 | 6 | |
f0ce888c ACM |
7 | struct cpu_topology_map { |
8 | int socket_id; | |
9 | int core_id; | |
10 | }; | |
11 | ||
720e98b5 JO |
12 | struct cpu_cache_level { |
13 | u32 level; | |
14 | u32 line_size; | |
15 | u32 sets; | |
16 | u32 ways; | |
17 | char *type; | |
18 | char *size; | |
19 | char *map; | |
20 | }; | |
21 | ||
c60da22a JO |
22 | struct numa_node { |
23 | u32 node; | |
24 | u64 mem_total; | |
25 | u64 mem_free; | |
26 | struct cpu_map *map; | |
27 | }; | |
28 | ||
f0ce888c ACM |
29 | struct perf_env { |
30 | char *hostname; | |
31 | char *os_release; | |
32 | char *version; | |
33 | char *arch; | |
34 | int nr_cpus_online; | |
35 | int nr_cpus_avail; | |
36 | char *cpu_desc; | |
37 | char *cpuid; | |
38 | unsigned long long total_mem; | |
e0838e02 | 39 | unsigned int msr_pmu_type; |
f0ce888c ACM |
40 | |
41 | int nr_cmdline; | |
42 | int nr_sibling_cores; | |
43 | int nr_sibling_threads; | |
44 | int nr_numa_nodes; | |
45 | int nr_pmu_mappings; | |
46 | int nr_groups; | |
47 | char *cmdline; | |
48 | const char **cmdline_argv; | |
49 | char *sibling_cores; | |
50 | char *sibling_threads; | |
f0ce888c ACM |
51 | char *pmu_mappings; |
52 | struct cpu_topology_map *cpu; | |
720e98b5 JO |
53 | struct cpu_cache_level *caches; |
54 | int caches_cnt; | |
c60da22a | 55 | struct numa_node *numa_nodes; |
f0ce888c ACM |
56 | }; |
57 | ||
b6998692 ACM |
58 | extern struct perf_env perf_env; |
59 | ||
f0ce888c ACM |
60 | void perf_env__exit(struct perf_env *env); |
61 | ||
b6998692 ACM |
62 | int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]); |
63 | ||
aa36ddd7 ACM |
64 | int perf_env__read_cpu_topology_map(struct perf_env *env); |
65 | ||
720e98b5 | 66 | void cpu_cache_level__free(struct cpu_cache_level *cache); |
f0ce888c | 67 | #endif /* __PERF_ENV_H */ |