summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/cputopo.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2019-02-19 10:58:14 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-02-19 16:21:06 +0100
commit48e6c5acd36873ff022cd97de866bfd0a36a3b99 (patch)
tree5c3dd2981a49b4b1b67a1813125a7cb1b35660a6 /tools/perf/util/cputopo.h
parentperf tools: Add cpu_topology object (diff)
downloadlinux-48e6c5acd36873ff022cd97de866bfd0a36a3b99.tar.xz
linux-48e6c5acd36873ff022cd97de866bfd0a36a3b99.zip
perf tools: Add numa_topology object
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>
Diffstat (limited to 'tools/perf/util/cputopo.h')
-rw-r--r--tools/perf/util/cputopo.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/util/cputopo.h b/tools/perf/util/cputopo.h
index 4b5f4112b6f8..47a97e71acdf 100644
--- a/tools/perf/util/cputopo.h
+++ b/tools/perf/util/cputopo.h
@@ -3,6 +3,7 @@
#define __PERF_CPUTOPO_H
#include <linux/types.h>
+#include "env.h"
struct cpu_topology {
u32 core_sib;
@@ -11,7 +12,22 @@ struct cpu_topology {
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 */