Lines Matching +full:8 +full:- +full:cpu
1 // SPDX-License-Identifier: GPL-2.0
6 #include "util/synthetic-events.h"
19 struct perf_record_cpu_map *map_event = &event->cpu_map; in process_event_mask()
24 data = &map_event->data; in process_event_mask()
26 TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__MASK); in process_event_mask()
28 long_size = data->mask32_data.long_size; in process_event_mask()
30 TEST_ASSERT_VAL("wrong long_size", long_size == 4 || long_size == 8); in process_event_mask()
32 TEST_ASSERT_VAL("wrong nr", data->mask32_data.nr == 1); in process_event_mask()
34 TEST_ASSERT_VAL("wrong cpu", perf_record_cpu_map_data__test_bit(0, data)); in process_event_mask()
35 TEST_ASSERT_VAL("wrong cpu", !perf_record_cpu_map_data__test_bit(1, data)); in process_event_mask()
37 TEST_ASSERT_VAL("wrong cpu", perf_record_cpu_map_data__test_bit(i, data)); in process_event_mask()
42 TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__cpu(map, 0).cpu == 0); in process_event_mask()
44 TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__cpu(map, i - 1).cpu == i); in process_event_mask()
55 struct perf_record_cpu_map *map_event = &event->cpu_map; in process_event_cpus()
59 data = &map_event->data; in process_event_cpus()
61 TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__CPUS); in process_event_cpus()
63 TEST_ASSERT_VAL("wrong nr", data->cpus_data.nr == 2); in process_event_cpus()
64 TEST_ASSERT_VAL("wrong cpu", data->cpus_data.cpu[0] == 1); in process_event_cpus()
65 TEST_ASSERT_VAL("wrong cpu", data->cpus_data.cpu[1] == 256); in process_event_cpus()
69 TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__cpu(map, 0).cpu == 1); in process_event_cpus()
70 TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__cpu(map, 1).cpu == 256); in process_event_cpus()
81 struct perf_record_cpu_map *map_event = &event->cpu_map; in process_event_range_cpus()
85 data = &map_event->data; in process_event_range_cpus()
87 TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__RANGE_CPUS); in process_event_range_cpus()
89 TEST_ASSERT_VAL("wrong any_cpu", data->range_cpu_data.any_cpu == 0); in process_event_range_cpus()
90 TEST_ASSERT_VAL("wrong start_cpu", data->range_cpu_data.start_cpu == 1); in process_event_range_cpus()
91 TEST_ASSERT_VAL("wrong end_cpu", data->range_cpu_data.end_cpu == 256); in process_event_range_cpus()
95 TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__cpu(map, 0).cpu == 1); in process_event_range_cpus()
96 TEST_ASSERT_VAL("wrong cpu", perf_cpu_map__max(map).cpu == 256); in process_event_range_cpus()
108 cpus = perf_cpu_map__new("0,2-20"); in test__cpu_map_synthesize()
115 /* This one is better stored in cpu values. */ in test__cpu_map_synthesize()
124 cpus = perf_cpu_map__new("1-256"); in test__cpu_map_synthesize()
139 return -1; in cpu_map_print()
151 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1,3,5,7,9,11,13,15,17,19,21-40")); in test__cpu_map_print()
152 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("2-5")); in test__cpu_map_print()
153 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1,3-6,8-10,24,35-37")); in test__cpu_map_print()
154 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1,3-6,8-10,24,35-37")); in test__cpu_map_print()
155 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1-10,12-20,22-30,32-40")); in test__cpu_map_print()
168 TEST_ASSERT_VAL("failed to merge map: bad result", !strcmp(buf, "1-2,4-5,7")); in test__cpu_map_merge()
198 ret = __test__cpu_map_intersect("1-8", "6-9", 3, "6-8"); in test__cpu_map_intersect()
201 ret = __test__cpu_map_intersect("1-8,12-20", "6-9,15", 4, "6-8,15"); in test__cpu_map_intersect()
220 struct perf_cpu_map *pair = perf_cpu_map__new("1-2"); in test__cpu_map_equal()
251 TEST_CASE("Synthesize cpu map", cpu_map_synthesize),
252 TEST_CASE("Print cpu map", cpu_map_print),
253 TEST_CASE("Merge cpu map", cpu_map_merge),
254 TEST_CASE("Intersect cpu map", cpu_map_intersect),
255 TEST_CASE("Equal cpu map", cpu_map_equal),
260 .desc = "CPU map",