1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/types.h>
6 #include <linux/rbtree.h>
11 struct cpu_topology_map
{
17 struct cpu_cache_level
{
31 struct perf_cpu_map
*map
;
49 unsigned long long total_mem
;
50 unsigned int msr_pmu_type
;
55 int nr_sibling_threads
;
61 const char **cmdline_argv
;
64 char *sibling_threads
;
66 struct cpu_topology_map
*cpu
;
67 struct cpu_cache_level
*caches
;
74 struct numa_node
*numa_nodes
;
75 struct memory_node
*memory_nodes
;
76 unsigned long long memory_bsize
;
80 * bpf_info_lock protects bpf rbtrees. This is needed because the
81 * trees are accessed by different threads in perf-top
84 struct rw_semaphore lock
;
91 /* For fast cpu to numa node lookup via perf_env__numa_node */
96 enum perf_compress_type
{
102 struct bpf_prog_info_node
;
105 extern struct perf_env perf_env
;
107 void perf_env__exit(struct perf_env
*env
);
109 int perf_env__set_cmdline(struct perf_env
*env
, int argc
, const char *argv
[]);
111 int perf_env__read_cpuid(struct perf_env
*env
);
112 int perf_env__read_cpu_topology_map(struct perf_env
*env
);
114 void cpu_cache_level__free(struct cpu_cache_level
*cache
);
116 const char *perf_env__arch(struct perf_env
*env
);
117 const char *perf_env__raw_arch(struct perf_env
*env
);
118 int perf_env__nr_cpus_avail(struct perf_env
*env
);
120 void perf_env__init(struct perf_env
*env
);
121 void perf_env__insert_bpf_prog_info(struct perf_env
*env
,
122 struct bpf_prog_info_node
*info_node
);
123 struct bpf_prog_info_node
*perf_env__find_bpf_prog_info(struct perf_env
*env
,
125 void perf_env__insert_btf(struct perf_env
*env
, struct btf_node
*btf_node
);
126 struct btf_node
*perf_env__find_btf(struct perf_env
*env
, __u32 btf_id
);
128 int perf_env__numa_node(struct perf_env
*env
, int cpu
);
129 #endif /* __PERF_ENV_H */