2015-09-08 16:30:00 +00:00
|
|
|
#ifndef __PERF_ENV_H
|
|
|
|
#define __PERF_ENV_H
|
|
|
|
|
2016-02-16 15:01:43 +00:00
|
|
|
#include <linux/types.h>
|
2016-07-04 12:16:20 +00:00
|
|
|
#include "cpumap.h"
|
2016-02-16 15:01:43 +00:00
|
|
|
|
2015-09-08 16:30:00 +00:00
|
|
|
struct cpu_topology_map {
|
|
|
|
int socket_id;
|
|
|
|
int core_id;
|
|
|
|
};
|
|
|
|
|
2016-02-16 15:01:43 +00:00
|
|
|
struct cpu_cache_level {
|
|
|
|
u32 level;
|
|
|
|
u32 line_size;
|
|
|
|
u32 sets;
|
|
|
|
u32 ways;
|
|
|
|
char *type;
|
|
|
|
char *size;
|
|
|
|
char *map;
|
|
|
|
};
|
|
|
|
|
2016-07-04 12:16:20 +00:00
|
|
|
struct numa_node {
|
|
|
|
u32 node;
|
|
|
|
u64 mem_total;
|
|
|
|
u64 mem_free;
|
|
|
|
struct cpu_map *map;
|
|
|
|
};
|
|
|
|
|
2015-09-08 16:30:00 +00:00
|
|
|
struct perf_env {
|
|
|
|
char *hostname;
|
|
|
|
char *os_release;
|
|
|
|
char *version;
|
|
|
|
char *arch;
|
|
|
|
int nr_cpus_online;
|
|
|
|
int nr_cpus_avail;
|
|
|
|
char *cpu_desc;
|
|
|
|
char *cpuid;
|
|
|
|
unsigned long long total_mem;
|
2015-09-10 14:03:05 +00:00
|
|
|
unsigned int msr_pmu_type;
|
2015-09-08 16:30:00 +00:00
|
|
|
|
|
|
|
int nr_cmdline;
|
|
|
|
int nr_sibling_cores;
|
|
|
|
int nr_sibling_threads;
|
|
|
|
int nr_numa_nodes;
|
|
|
|
int nr_pmu_mappings;
|
|
|
|
int nr_groups;
|
|
|
|
char *cmdline;
|
|
|
|
const char **cmdline_argv;
|
|
|
|
char *sibling_cores;
|
|
|
|
char *sibling_threads;
|
|
|
|
char *pmu_mappings;
|
|
|
|
struct cpu_topology_map *cpu;
|
2016-02-16 15:01:43 +00:00
|
|
|
struct cpu_cache_level *caches;
|
|
|
|
int caches_cnt;
|
2016-07-04 12:16:20 +00:00
|
|
|
struct numa_node *numa_nodes;
|
2015-09-08 16:30:00 +00:00
|
|
|
};
|
|
|
|
|
2015-09-08 19:58:20 +00:00
|
|
|
extern struct perf_env perf_env;
|
|
|
|
|
2015-09-08 16:30:00 +00:00
|
|
|
void perf_env__exit(struct perf_env *env);
|
|
|
|
|
2015-09-08 19:58:20 +00:00
|
|
|
int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]);
|
|
|
|
|
2015-09-09 13:37:01 +00:00
|
|
|
int perf_env__read_cpu_topology_map(struct perf_env *env);
|
|
|
|
|
2016-02-16 15:01:43 +00:00
|
|
|
void cpu_cache_level__free(struct cpu_cache_level *cache);
|
2015-09-08 16:30:00 +00:00
|
|
|
#endif /* __PERF_ENV_H */
|