]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - tools/perf/util/env.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / tools / perf / util / env.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
f0ce888c
ACM
2#ifndef __PERF_ENV_H
3#define __PERF_ENV_H
4
720e98b5 5#include <linux/types.h>
c60da22a 6#include "cpumap.h"
720e98b5 7
f0ce888c
ACM
8struct cpu_topology_map {
9 int socket_id;
10 int core_id;
11};
12
720e98b5
JO
13struct cpu_cache_level {
14 u32 level;
15 u32 line_size;
16 u32 sets;
17 u32 ways;
18 char *type;
19 char *size;
20 char *map;
21};
22
c60da22a
JO
23struct numa_node {
24 u32 node;
25 u64 mem_total;
26 u64 mem_free;
27 struct cpu_map *map;
28};
29
f0ce888c
ACM
30struct perf_env {
31 char *hostname;
32 char *os_release;
33 char *version;
34 char *arch;
35 int nr_cpus_online;
36 int nr_cpus_avail;
37 char *cpu_desc;
38 char *cpuid;
39 unsigned long long total_mem;
e0838e02 40 unsigned int msr_pmu_type;
f0ce888c
ACM
41
42 int nr_cmdline;
43 int nr_sibling_cores;
44 int nr_sibling_threads;
45 int nr_numa_nodes;
46 int nr_pmu_mappings;
47 int nr_groups;
48 char *cmdline;
49 const char **cmdline_argv;
50 char *sibling_cores;
51 char *sibling_threads;
f0ce888c
ACM
52 char *pmu_mappings;
53 struct cpu_topology_map *cpu;
720e98b5
JO
54 struct cpu_cache_level *caches;
55 int caches_cnt;
c60da22a 56 struct numa_node *numa_nodes;
f0ce888c
ACM
57};
58
b6998692
ACM
59extern struct perf_env perf_env;
60
f0ce888c
ACM
61void perf_env__exit(struct perf_env *env);
62
b6998692
ACM
63int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]);
64
aa36ddd7
ACM
65int perf_env__read_cpu_topology_map(struct perf_env *env);
66
720e98b5 67void cpu_cache_level__free(struct cpu_cache_level *cache);
f0ce888c 68#endif /* __PERF_ENV_H */