linux/tools/perf/util/env.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2#ifndef __PERF_ENV_H
   3#define __PERF_ENV_H
   4
   5#include <linux/types.h>
   6#include "cpumap.h"
   7
   8struct cpu_topology_map {
   9        int     socket_id;
  10        int     core_id;
  11};
  12
  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
  23struct numa_node {
  24        u32              node;
  25        u64              mem_total;
  26        u64              mem_free;
  27        struct cpu_map  *map;
  28};
  29
  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;
  40        unsigned int            msr_pmu_type;
  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;
  52        char                    *pmu_mappings;
  53        struct cpu_topology_map *cpu;
  54        struct cpu_cache_level  *caches;
  55        int                      caches_cnt;
  56        struct numa_node        *numa_nodes;
  57};
  58
  59extern struct perf_env perf_env;
  60
  61void perf_env__exit(struct perf_env *env);
  62
  63int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[]);
  64
  65int perf_env__read_cpu_topology_map(struct perf_env *env);
  66
  67void cpu_cache_level__free(struct cpu_cache_level *cache);
  68#endif /* __PERF_ENV_H */
  69