Linux Perf
env.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_ENV_H
3 #define __PERF_ENV_H
4 
5 #include <linux/types.h>
6 #include "cpumap.h"
7 
9  int socket_id;
10  int core_id;
11 };
12 
14  u32 level;
15  u32 line_size;
16  u32 sets;
17  u32 ways;
18  char *type;
19  char *size;
20  char *map;
21 };
22 
23 struct numa_node {
24  u32 node;
25  u64 mem_total;
26  u64 mem_free;
27  struct cpu_map *map;
28 };
29 
30 struct memory_node {
31  u64 node;
32  u64 size;
33  unsigned long *set;
34 };
35 
36 struct perf_env {
37  char *hostname;
38  char *os_release;
39  char *version;
40  char *arch;
43  char *cpu_desc;
44  char *cpuid;
45  unsigned long long total_mem;
46  unsigned int msr_pmu_type;
47 
54  int nr_groups;
55  char *cmdline;
56  const char **cmdline_argv;
59  char *pmu_mappings;
65  unsigned long long memory_bsize;
66 };
67 
68 extern struct perf_env perf_env;
69 
70 void perf_env__exit(struct perf_env *env);
71 
72 int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]);
73 
75 
76 void cpu_cache_level__free(struct cpu_cache_level *cache);
77 
78 const char *perf_env__arch(struct perf_env *env);
79 const char *perf_env__raw_arch(struct perf_env *env);
80 int perf_env__nr_cpus_avail(struct perf_env *env);
81 
82 #endif /* __PERF_ENV_H */
Definition: env.h:36
int nr_sibling_cores
Definition: env.h:49
const char ** cmdline_argv
Definition: env.h:56
char * sibling_cores
Definition: env.h:57
struct numa_node * numa_nodes
Definition: env.h:63
int nr_cpus_online
Definition: env.h:41
int perf_env__nr_cpus_avail(struct perf_env *env)
Definition: env.c:122
char * cmdline
Definition: env.h:55
const char * perf_env__arch(struct perf_env *env)
Definition: env.c:164
u64 node
Definition: env.h:31
Definition: cpumap.h:12
char * hostname
Definition: env.h:37
u64 size
Definition: env.h:32
u32 node
Definition: env.h:24
int nr_numa_nodes
Definition: env.h:51
char * arch
Definition: env.h:40
unsigned long long memory_bsize
Definition: env.h:65
int nr_cpus_avail
Definition: env.h:42
int perf_env__read_cpu_topology_map(struct perf_env *env)
Definition: env.c:69
char * os_release
Definition: env.h:38
unsigned long long total_mem
Definition: env.h:45
u32 level
Definition: env.h:14
char * map
Definition: env.h:20
struct cpu_topology_map * cpu
Definition: env.h:60
char * pmu_mappings
Definition: env.h:59
struct memory_node * memory_nodes
Definition: env.h:64
int nr_groups
Definition: env.h:54
char * cpuid
Definition: env.h:44
u32 sets
Definition: env.h:16
const char * perf_env__raw_arch(struct perf_env *env)
Definition: env.c:117
int socket_id
Definition: env.h:9
struct cpu_cache_level * caches
Definition: env.h:61
int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[])
Definition: env.c:41
int nr_sibling_threads
Definition: env.h:50
char * cpu_desc
Definition: env.h:43
int core_id
Definition: env.h:10
u64 mem_free
Definition: env.h:26
void cpu_cache_level__free(struct cpu_cache_level *cache)
Definition: env.c:127
unsigned int msr_pmu_type
Definition: env.h:46
int nr_memory_nodes
Definition: env.h:52
int caches_cnt
Definition: env.h:62
char * size
Definition: env.h:19
Definition: env.h:23
struct cpu_map * map
Definition: env.h:27
u64 mem_total
Definition: env.h:25
u32 line_size
Definition: env.h:15
char * version
Definition: env.h:39
u32 ways
Definition: env.h:17
int nr_pmu_mappings
Definition: env.h:53
int nr_cmdline
Definition: env.h:48
char * type
Definition: env.h:18
char * sibling_threads
Definition: env.h:58
void perf_env__exit(struct perf_env *env)
Definition: env.c:11