mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
48e6c5acd3
Add the numa_topology object to return the list of numa nodes together with their cpus. It will replace the numa code in header.c and will be used from 'perf record' in the following patches. Add the following interface functions to load numa details: struct numa_topology *numa_topology__new(void); void numa_topology__delete(struct numa_topology *tp); And replace the current (copied) local interface, with no functional changes. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20190219095815.15931-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
34 lines
645 B
C
34 lines
645 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __PERF_CPUTOPO_H
|
|
#define __PERF_CPUTOPO_H
|
|
|
|
#include <linux/types.h>
|
|
#include "env.h"
|
|
|
|
struct cpu_topology {
|
|
u32 core_sib;
|
|
u32 thread_sib;
|
|
char **core_siblings;
|
|
char **thread_siblings;
|
|
};
|
|
|
|
struct numa_topology_node {
|
|
char *cpus;
|
|
u32 node;
|
|
u64 mem_total;
|
|
u64 mem_free;
|
|
};
|
|
|
|
struct numa_topology {
|
|
u32 nr;
|
|
struct numa_topology_node nodes[0];
|
|
};
|
|
|
|
struct cpu_topology *cpu_topology__new(void);
|
|
void cpu_topology__delete(struct cpu_topology *tp);
|
|
|
|
struct numa_topology *numa_topology__new(void);
|
|
void numa_topology__delete(struct numa_topology *tp);
|
|
|
|
#endif /* __PERF_CPUTOPO_H */
|