1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/types.h>
6 #include <linux/rbtree.h>
10 struct cpu_topology_map
{
15 struct cpu_cache_level
{
47 unsigned long long total_mem
;
48 unsigned int msr_pmu_type
;
52 int nr_sibling_threads
;
58 const char **cmdline_argv
;
60 char *sibling_threads
;
62 struct cpu_topology_map
*cpu
;
63 struct cpu_cache_level
*caches
;
65 struct numa_node
*numa_nodes
;
66 struct memory_node
*memory_nodes
;
67 unsigned long long memory_bsize
;
71 * bpf_info_lock protects bpf rbtrees. This is needed because the
72 * trees are accessed by different threads in perf-top
75 struct rw_semaphore lock
;
83 struct bpf_prog_info_node
;
86 extern struct perf_env perf_env
;
88 void perf_env__exit(struct perf_env
*env
);
90 int perf_env__set_cmdline(struct perf_env
*env
, int argc
, const char *argv
[]);
92 int perf_env__read_cpu_topology_map(struct perf_env
*env
);
94 void cpu_cache_level__free(struct cpu_cache_level
*cache
);
96 const char *perf_env__arch(struct perf_env
*env
);
97 const char *perf_env__raw_arch(struct perf_env
*env
);
98 int perf_env__nr_cpus_avail(struct perf_env
*env
);
100 void perf_env__init(struct perf_env
*env
);
101 void perf_env__insert_bpf_prog_info(struct perf_env
*env
,
102 struct bpf_prog_info_node
*info_node
);
103 struct bpf_prog_info_node
*perf_env__find_bpf_prog_info(struct perf_env
*env
,
105 void perf_env__insert_btf(struct perf_env
*env
, struct btf_node
*btf_node
);
106 struct btf_node
*perf_env__find_btf(struct perf_env
*env
, __u32 btf_id
);
107 #endif /* __PERF_ENV_H */