blob: 56cffb60a0b42e456a11fb2bd489d74a69893b0c [file] [log] [blame]
Arnaldo Carvalho de Melof0ce8882015-09-08 13:30:00 -03001#ifndef __PERF_ENV_H
2#define __PERF_ENV_H
3
Jiri Olsa720e98b2016-02-16 16:01:43 +01004#include <linux/types.h>
5
Arnaldo Carvalho de Melof0ce8882015-09-08 13:30:00 -03006struct cpu_topology_map {
7 int socket_id;
8 int core_id;
9};
10
Jiri Olsa720e98b2016-02-16 16:01:43 +010011struct cpu_cache_level {
12 u32 level;
13 u32 line_size;
14 u32 sets;
15 u32 ways;
16 char *type;
17 char *size;
18 char *map;
19};
20
Arnaldo Carvalho de Melof0ce8882015-09-08 13:30:00 -030021struct perf_env {
22 char *hostname;
23 char *os_release;
24 char *version;
25 char *arch;
26 int nr_cpus_online;
27 int nr_cpus_avail;
28 char *cpu_desc;
29 char *cpuid;
30 unsigned long long total_mem;
Kan Liange0838e02015-09-10 11:03:05 -030031 unsigned int msr_pmu_type;
Arnaldo Carvalho de Melof0ce8882015-09-08 13:30:00 -030032
33 int nr_cmdline;
34 int nr_sibling_cores;
35 int nr_sibling_threads;
36 int nr_numa_nodes;
37 int nr_pmu_mappings;
38 int nr_groups;
39 char *cmdline;
40 const char **cmdline_argv;
41 char *sibling_cores;
42 char *sibling_threads;
43 char *numa_nodes;
44 char *pmu_mappings;
45 struct cpu_topology_map *cpu;
Jiri Olsa720e98b2016-02-16 16:01:43 +010046 struct cpu_cache_level *caches;
47 int caches_cnt;
Arnaldo Carvalho de Melof0ce8882015-09-08 13:30:00 -030048};
49
Arnaldo Carvalho de Melob6998692015-09-08 16:58:20 -030050extern struct perf_env perf_env;
51
Arnaldo Carvalho de Melof0ce8882015-09-08 13:30:00 -030052void perf_env__exit(struct perf_env *env);
53
Arnaldo Carvalho de Melob6998692015-09-08 16:58:20 -030054int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]);
55
Arnaldo Carvalho de Meloaa36ddd2015-09-09 10:37:01 -030056int perf_env__read_cpu_topology_map(struct perf_env *env);
57
Jiri Olsa720e98b2016-02-16 16:01:43 +010058void cpu_cache_level__free(struct cpu_cache_level *cache);
Arnaldo Carvalho de Melof0ce8882015-09-08 13:30:00 -030059#endif /* __PERF_ENV_H */