7 #include <sys/utsname.h> 54 for (i = 0; i <
argc ; i++) {
83 env->
cpu = calloc(nr_cpus,
sizeof(env->
cpu[0]));
87 for (cpu = 0; cpu < nr_cpus; ++
cpu) {
104 env->
arch = strdup(uts.machine);
106 return env->
arch ? 0 : -ENOMEM;
140 if (!strcmp(arch,
"x86_64"))
142 if (arch[0] ==
'i' && arch[2] ==
'8' && arch[3] ==
'6')
144 if (!strcmp(arch,
"sun4u") || !strncmp(arch,
"sparc", 5))
146 if (!strcmp(arch,
"aarch64") || !strcmp(arch,
"arm64"))
148 if (!strncmp(arch,
"arm", 3) || !strcmp(arch,
"sa110"))
150 if (!strncmp(arch,
"s390", 4))
152 if (!strncmp(arch,
"parisc", 6))
154 if (!strncmp(arch,
"powerpc", 7) || !strncmp(arch,
"ppc", 3))
156 if (!strncmp(arch,
"mips", 4))
158 if (!strncmp(arch,
"sh", 2) &&
isdigit(arch[2]))
172 arch_name = uts.machine;
174 arch_name = env->
arch;
int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[])
const char ** cmdline_argv
struct numa_node * numa_nodes
void cpu_map__put(struct cpu_map *map)
void perf_env__exit(struct perf_env *env)
struct cpu_topology_map * cpu
struct memory_node * memory_nodes
int cpu__max_present_cpu(void)
static int perf_env__read_arch(struct perf_env *env)
const char * perf_env__arch(struct perf_env *env)
struct cpu_cache_level * caches
static const char * normalize_arch(char *arch)
int cpu_map__get_socket_id(int cpu)
int perf_env__nr_cpus_avail(struct perf_env *env)
int perf_env__read_cpu_topology_map(struct perf_env *env)
int cpu_map__get_core_id(int cpu)
const char * perf_env__raw_arch(struct perf_env *env)
static int perf_env__read_nr_cpus_avail(struct perf_env *env)
void cpu_cache_level__free(struct cpu_cache_level *cache)