• Home
  • Raw
  • Download

Lines Matching +full:cpu +full:- +full:map

1 // SPDX-License-Identifier: GPL-2.0
13 #define TEMPL "/tmp/perf-test-XXXXXX"
25 return -1; in get_temp()
43 session->evlist = perf_evlist__new_default(); in session_write_header()
44 TEST_ASSERT_VAL("can't get evlist", session->evlist); in session_write_header()
46 perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY); in session_write_header()
47 perf_header__set_feat(&session->header, HEADER_NRCPUS); in session_write_header()
48 perf_header__set_feat(&session->header, HEADER_ARCH); in session_write_header()
50 session->header.data_size += DATA_SIZE; in session_write_header()
53 !perf_session__write_header(session, session->evlist, data.file.fd, true)); in session_write_header()
55 evlist__delete(session->evlist); in session_write_header()
61 static int check_cpu_topology(char *path, struct perf_cpu_map *map) in check_cpu_topology() argument
76 * cpu is a NULL pointer. in check_cpu_topology()
78 * CPU 0 is on core_id 0 and physical_package_id 6 in check_cpu_topology()
79 * CPU 1 is on core_id 1 and physical_package_id 3 in check_cpu_topology()
82 * dependend and might have higher numbers than the CPU id. in check_cpu_topology()
91 if (!session->header.env.cpu) in check_cpu_topology()
94 for (i = 0; i < session->header.env.nr_cpus_avail; i++) { in check_cpu_topology()
95 if (!cpu_map__has(map, i)) in check_cpu_topology()
97 pr_debug("CPU %d, core %d, socket %d\n", i, in check_cpu_topology()
98 session->header.env.cpu[i].core_id, in check_cpu_topology()
99 session->header.env.cpu[i].socket_id); in check_cpu_topology()
102 for (i = 0; i < map->nr; i++) { in check_cpu_topology()
104 (session->header.env.cpu[map->map[i]].core_id == (cpu_map__get_core(map, i, NULL) & 0xffff))); in check_cpu_topology()
107 (session->header.env.cpu[map->map[i]].socket_id == cpu_map__get_socket(map, i, NULL))); in check_cpu_topology()
118 struct perf_cpu_map *map; in test__session_topology() local
128 map = perf_cpu_map__new(NULL); in test__session_topology()
129 if (map == NULL) { in test__session_topology()
134 ret = check_cpu_topology(path, map); in test__session_topology()
135 perf_cpu_map__put(map); in test__session_topology()