diff options
Diffstat (limited to 'tools/perf/tests/topology.c')
-rw-r--r-- | tools/perf/tests/topology.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 9497d02f69e6..4a800499d7c3 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -2,11 +2,13 @@ #include <string.h> #include <stdlib.h> #include <stdio.h> +#include <perf/cpumap.h> +#include "cpumap.h" #include "tests.h" -#include "util.h" #include "session.h" #include "evlist.h" #include "debug.h" +#include <linux/err.h> #define TEMPL "/tmp/perf-test-XXXXXX" #define DATA_SIZE 10 @@ -38,7 +40,7 @@ static int session_write_header(char *path) }; session = perf_session__new(&data, false, NULL); - TEST_ASSERT_VAL("can't get session", session); + TEST_ASSERT_VAL("can't get session", !IS_ERR(session)); session->evlist = perf_evlist__new_default(); TEST_ASSERT_VAL("can't get evlist", session->evlist); @@ -57,7 +59,7 @@ static int session_write_header(char *path) return 0; } -static int check_cpu_topology(char *path, struct cpu_map *map) +static int check_cpu_topology(char *path, struct perf_cpu_map *map) { struct perf_session *session; struct perf_data data = { @@ -69,7 +71,7 @@ static int check_cpu_topology(char *path, struct cpu_map *map) int i; session = perf_session__new(&data, false, NULL); - TEST_ASSERT_VAL("can't get session", session); + TEST_ASSERT_VAL("can't get session", !IS_ERR(session)); /* On platforms with large numbers of CPUs process_cpu_topology() * might issue an error while reading the perf.data file section @@ -116,7 +118,7 @@ static int check_cpu_topology(char *path, struct cpu_map *map) int test__session_topology(struct test *test __maybe_unused, int subtest __maybe_unused) { char path[PATH_MAX]; - struct cpu_map *map; + struct perf_cpu_map *map; int ret = TEST_FAIL; TEST_ASSERT_VAL("can't get templ file", !get_temp(path)); @@ -126,14 +128,14 @@ int test__session_topology(struct test *test __maybe_unused, int subtest __maybe if (session_write_header(path)) goto free_path; - map = cpu_map__new(NULL); + map = perf_cpu_map__new(NULL); if (map == NULL) { pr_debug("failed to get system cpumap\n"); goto free_path; } ret = check_cpu_topology(path, map); - cpu_map__put(map); + perf_cpu_map__put(map); free_path: unlink(path); |