Commit 194a3a20 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf cpumap: Document cpu__get_node() and remove redundant function

cpu_map__get_node_id() isn't used externally and merely delegates to
cpu__get_node().
Reviewed-by: default avatarJames Clark <james.clark@arm.com>
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Riccardo Mancini <rickyman7@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Vineet Singh <vineet.singh@intel.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: zhengjun.xing@intel.com
Link: https://lore.kernel.org/r/20220105061351.120843-16-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 51b826fa
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
static int max_cpu_num; static int max_cpu_num;
static int max_present_cpu_num; static int max_present_cpu_num;
static int max_node_num; static int max_node_num;
/**
* The numa node X as read from /sys/devices/system/node/nodeX indexed by the
* CPU number.
*/
static int *cpunode_map; static int *cpunode_map;
static struct perf_cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus) static struct perf_cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus)
...@@ -222,11 +226,6 @@ int cpu_map__get_core_id(int cpu) ...@@ -222,11 +226,6 @@ int cpu_map__get_core_id(int cpu)
return ret ?: value; return ret ?: value;
} }
int cpu_map__get_node_id(int cpu)
{
return cpu__get_node(cpu);
}
struct aggr_cpu_id cpu_map__get_core_aggr_by_cpu(int cpu, void *data) struct aggr_cpu_id cpu_map__get_core_aggr_by_cpu(int cpu, void *data)
{ {
struct aggr_cpu_id id; struct aggr_cpu_id id;
...@@ -250,7 +249,7 @@ struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data __maybe_unu ...@@ -250,7 +249,7 @@ struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data __maybe_unu
{ {
struct aggr_cpu_id id = aggr_cpu_id__empty(); struct aggr_cpu_id id = aggr_cpu_id__empty();
id.node = cpu_map__get_node_id(cpu); id.node = cpu__get_node(cpu);
return id; return id;
} }
......
...@@ -45,7 +45,6 @@ int cpu_map__get_die_id(int cpu); ...@@ -45,7 +45,6 @@ int cpu_map__get_die_id(int cpu);
struct aggr_cpu_id cpu_map__get_die_aggr_by_cpu(int cpu, void *data); struct aggr_cpu_id cpu_map__get_die_aggr_by_cpu(int cpu, void *data);
int cpu_map__get_core_id(int cpu); int cpu_map__get_core_id(int cpu);
struct aggr_cpu_id cpu_map__get_core_aggr_by_cpu(int cpu, void *data); struct aggr_cpu_id cpu_map__get_core_aggr_by_cpu(int cpu, void *data);
int cpu_map__get_node_id(int cpu);
struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data); struct aggr_cpu_id cpu_map__get_node_aggr_by_cpu(int cpu, void *data);
int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **sockp); int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **sockp);
int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **diep); int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **diep);
...@@ -58,6 +57,10 @@ int cpu__setup_cpunode_map(void); ...@@ -58,6 +57,10 @@ int cpu__setup_cpunode_map(void);
int cpu__max_node(void); int cpu__max_node(void);
int cpu__max_cpu(void); int cpu__max_cpu(void);
int cpu__max_present_cpu(void); int cpu__max_present_cpu(void);
/**
* cpu__get_node - Returns the numa node X as read from
* /sys/devices/system/node/nodeX for the given CPU.
*/
int cpu__get_node(int cpu); int cpu__get_node(int cpu);
int cpu_map__build_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **res, int cpu_map__build_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **res,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment