libperf cpumap: Replace usage of perf_cpu_map__new(NULL) with perf_cpu_map__new_online_cpus()
Passing NULL to perf_cpu_map__new() performs perf_cpu_map__new_online_cpus(), just directly call perf_cpu_map__new_online_cpus() to be more intention revealing. Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexandre Ghiti <alexghiti@rivosinc.com> Cc: Andrew Jones <ajones@ventanamicro.com> Cc: André Almeida <andrealmeid@igalia.com> Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com> Cc: Atish Patra <atishp@rivosinc.com> Cc: Changbin Du <changbin.du@huawei.com> Cc: Darren Hart <dvhart@infradead.org> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.g.garry@oracle.com> Cc: K Prateek Nayak <kprateek.nayak@amd.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: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Paran Lee <p4ranlee@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Sandipan Das <sandipan.das@amd.com> Cc: Sean Christopherson <seanjc@google.com> Cc: Steinar H. Gunderson <sesse@google.com> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will@kernel.org> Cc: Yang Jihong <yangjihong1@huawei.com> Cc: Yang Li <yang.lee@linux.alibaba.com> Cc: Yanteng Si <siyanteng@loongson.cn> Cc: bpf@vger.kernel.org Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20231129060211.1890454-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
923ca62a7b
commit
effe957c6b
@@ -610,7 +610,7 @@ static int do_test_code_reading(bool try_kcore)
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
cpus = perf_cpu_map__new(NULL);
|
||||
cpus = perf_cpu_map__new_online_cpus();
|
||||
if (!cpus) {
|
||||
pr_debug("perf_cpu_map__new failed\n");
|
||||
goto out_put;
|
||||
|
||||
@@ -81,7 +81,7 @@ static int test__keep_tracking(struct test_suite *test __maybe_unused, int subte
|
||||
threads = thread_map__new(-1, getpid(), UINT_MAX);
|
||||
CHECK_NOT_NULL__(threads);
|
||||
|
||||
cpus = perf_cpu_map__new(NULL);
|
||||
cpus = perf_cpu_map__new_online_cpus();
|
||||
CHECK_NOT_NULL__(cpus);
|
||||
|
||||
evlist = evlist__new();
|
||||
|
||||
@@ -52,7 +52,7 @@ static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest
|
||||
return -1;
|
||||
}
|
||||
|
||||
cpus = perf_cpu_map__new(NULL);
|
||||
cpus = perf_cpu_map__new_online_cpus();
|
||||
if (cpus == NULL) {
|
||||
pr_debug("perf_cpu_map__new\n");
|
||||
goto out_free_threads;
|
||||
|
||||
@@ -37,7 +37,7 @@ static int test__openat_syscall_event_on_all_cpus(struct test_suite *test __mayb
|
||||
return -1;
|
||||
}
|
||||
|
||||
cpus = perf_cpu_map__new(NULL);
|
||||
cpus = perf_cpu_map__new_online_cpus();
|
||||
if (cpus == NULL) {
|
||||
pr_debug("perf_cpu_map__new\n");
|
||||
goto out_thread_map_delete;
|
||||
|
||||
@@ -93,7 +93,7 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su
|
||||
threads = thread_map__new(-1, getpid(), UINT_MAX);
|
||||
CHECK_NOT_NULL__(threads);
|
||||
|
||||
cpus = perf_cpu_map__new(NULL);
|
||||
cpus = perf_cpu_map__new_online_cpus();
|
||||
CHECK_NOT_NULL__(cpus);
|
||||
|
||||
evlist = evlist__new();
|
||||
|
||||
@@ -351,7 +351,7 @@ static int test__switch_tracking(struct test_suite *test __maybe_unused, int sub
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
cpus = perf_cpu_map__new(NULL);
|
||||
cpus = perf_cpu_map__new_online_cpus();
|
||||
if (!cpus) {
|
||||
pr_debug("perf_cpu_map__new failed!\n");
|
||||
goto out_err;
|
||||
|
||||
@@ -215,7 +215,7 @@ static int test__session_topology(struct test_suite *test __maybe_unused, int su
|
||||
if (session_write_header(path))
|
||||
goto free_path;
|
||||
|
||||
map = perf_cpu_map__new(NULL);
|
||||
map = perf_cpu_map__new_online_cpus();
|
||||
if (map == NULL) {
|
||||
pr_debug("failed to get system cpumap\n");
|
||||
goto free_path;
|
||||
|
||||
Reference in New Issue
Block a user