Arnaldo Carvalho de Melo | f0ce888 | 2015-09-08 13:30:00 -0300 | [diff] [blame] | 1 | #ifndef __PERF_ENV_H |
| 2 | #define __PERF_ENV_H |
| 3 | |
Jiri Olsa | 720e98b | 2016-02-16 16:01:43 +0100 | [diff] [blame] | 4 | #include <linux/types.h> |
| 5 | |
Arnaldo Carvalho de Melo | f0ce888 | 2015-09-08 13:30:00 -0300 | [diff] [blame] | 6 | struct cpu_topology_map { |
| 7 | int socket_id; |
| 8 | int core_id; |
| 9 | }; |
| 10 | |
Jiri Olsa | 720e98b | 2016-02-16 16:01:43 +0100 | [diff] [blame] | 11 | struct 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 Melo | f0ce888 | 2015-09-08 13:30:00 -0300 | [diff] [blame] | 21 | struct 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 Liang | e0838e0 | 2015-09-10 11:03:05 -0300 | [diff] [blame] | 31 | unsigned int msr_pmu_type; |
Arnaldo Carvalho de Melo | f0ce888 | 2015-09-08 13:30:00 -0300 | [diff] [blame] | 32 | |
| 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 Olsa | 720e98b | 2016-02-16 16:01:43 +0100 | [diff] [blame] | 46 | struct cpu_cache_level *caches; |
| 47 | int caches_cnt; |
Arnaldo Carvalho de Melo | f0ce888 | 2015-09-08 13:30:00 -0300 | [diff] [blame] | 48 | }; |
| 49 | |
Arnaldo Carvalho de Melo | b699869 | 2015-09-08 16:58:20 -0300 | [diff] [blame] | 50 | extern struct perf_env perf_env; |
| 51 | |
Arnaldo Carvalho de Melo | f0ce888 | 2015-09-08 13:30:00 -0300 | [diff] [blame] | 52 | void perf_env__exit(struct perf_env *env); |
| 53 | |
Arnaldo Carvalho de Melo | b699869 | 2015-09-08 16:58:20 -0300 | [diff] [blame] | 54 | int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]); |
| 55 | |
Arnaldo Carvalho de Melo | aa36ddd | 2015-09-09 10:37:01 -0300 | [diff] [blame] | 56 | int perf_env__read_cpu_topology_map(struct perf_env *env); |
| 57 | |
Jiri Olsa | 720e98b | 2016-02-16 16:01:43 +0100 | [diff] [blame] | 58 | void cpu_cache_level__free(struct cpu_cache_level *cache); |
Arnaldo Carvalho de Melo | f0ce888 | 2015-09-08 13:30:00 -0300 | [diff] [blame] | 59 | #endif /* __PERF_ENV_H */ |