Commit 2daa08c4 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf evsel: Rename CPU around get_group_fd

CPU is really a cpu map index, change names to make code more intention
revealing.
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: James Clark <james.clark@arm.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-38-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent da8c94c0
...@@ -1591,27 +1591,27 @@ int __evsel__read_on_cpu(struct evsel *evsel, int cpu_map_idx, int thread, bool ...@@ -1591,27 +1591,27 @@ int __evsel__read_on_cpu(struct evsel *evsel, int cpu_map_idx, int thread, bool
} }
static int evsel__match_other_cpu(struct evsel *evsel, struct evsel *other, static int evsel__match_other_cpu(struct evsel *evsel, struct evsel *other,
int cpu) int cpu_map_idx)
{ {
int cpuid; int cpu;
cpuid = perf_cpu_map__cpu(evsel->core.cpus, cpu); cpu = perf_cpu_map__cpu(evsel->core.cpus, cpu_map_idx);
return perf_cpu_map__idx(other->core.cpus, cpuid); return perf_cpu_map__idx(other->core.cpus, cpu);
} }
static int evsel__hybrid_group_cpu(struct evsel *evsel, int cpu) static int evsel__hybrid_group_cpu_map_idx(struct evsel *evsel, int cpu_map_idx)
{ {
struct evsel *leader = evsel__leader(evsel); struct evsel *leader = evsel__leader(evsel);
if ((evsel__is_hybrid(evsel) && !evsel__is_hybrid(leader)) || if ((evsel__is_hybrid(evsel) && !evsel__is_hybrid(leader)) ||
(!evsel__is_hybrid(evsel) && evsel__is_hybrid(leader))) { (!evsel__is_hybrid(evsel) && evsel__is_hybrid(leader))) {
return evsel__match_other_cpu(evsel, leader, cpu); return evsel__match_other_cpu(evsel, leader, cpu_map_idx);
} }
return cpu; return cpu_map_idx;
} }
static int get_group_fd(struct evsel *evsel, int cpu, int thread) static int get_group_fd(struct evsel *evsel, int cpu_map_idx, int thread)
{ {
struct evsel *leader = evsel__leader(evsel); struct evsel *leader = evsel__leader(evsel);
int fd; int fd;
...@@ -1625,11 +1625,11 @@ static int get_group_fd(struct evsel *evsel, int cpu, int thread) ...@@ -1625,11 +1625,11 @@ static int get_group_fd(struct evsel *evsel, int cpu, int thread)
*/ */
BUG_ON(!leader->core.fd); BUG_ON(!leader->core.fd);
cpu = evsel__hybrid_group_cpu(evsel, cpu); cpu_map_idx = evsel__hybrid_group_cpu_map_idx(evsel, cpu_map_idx);
if (cpu == -1) if (cpu_map_idx == -1)
return -1; return -1;
fd = FD(leader, cpu, thread); fd = FD(leader, cpu_map_idx, thread);
BUG_ON(fd == -1); BUG_ON(fd == -1);
return fd; return fd;
......
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