Lines Matching full:cpus
22 "which-cpus: [-h] [<key=value> [<key=value> ...]]\n\n" in help()
25 " <key=value>, outputs the cpulist for cpus which all match the given set\n" in help()
29 static void print_cpulist(cpu_set_t *cpus) in print_cpulist() argument
33 if (!CPU_COUNT(cpus)) { in print_cpulist()
34 printf("cpus: None\n"); in print_cpulist()
38 printf("cpus:"); in print_cpulist()
39 for (int i = 0, c = 0; i < CPU_COUNT(cpus); i++, c++) { in print_cpulist()
40 if (start != end && !CPU_ISSET(c, cpus)) in print_cpulist()
43 while (!CPU_ISSET(c, cpus)) in print_cpulist()
59 static void do_which_cpus(int argc, char **argv, cpu_set_t *cpus) in do_which_cpus() argument
78 …rc = riscv_hwprobe(pairs, nr_pairs, sizeof(cpu_set_t), (unsigned long *)cpus, RISCV_HWPROBE_WHICH_… in do_which_cpus()
80 print_cpulist(cpus); in do_which_cpus()
87 cpu_set_t cpus_aff, cpus; in main() local
116 CPU_ZERO(&cpus); in main()
117 rc = riscv_hwprobe(pairs, 1, 0, (unsigned long *)&cpus, RISCV_HWPROBE_WHICH_CPUS); in main()
122 ksft_test_result(rc == -EINVAL, "NULL cpus\n"); in main()
125 CPU_ZERO(&cpus); in main()
126 rc = riscv_hwprobe(pairs, 1, sizeof(cpu_set_t), (unsigned long *)&cpus, RISCV_HWPROBE_WHICH_CPUS); in main()
127 ksft_test_result(rc == 0 && CPU_COUNT(&cpus) == 0, "unknown key\n"); in main()
131 CPU_ZERO(&cpus); in main()
132 rc = riscv_hwprobe(pairs, 2, sizeof(cpu_set_t), (unsigned long *)&cpus, RISCV_HWPROBE_WHICH_CPUS); in main()
137 CPU_ZERO(&cpus); in main()
138 rc = riscv_hwprobe(pairs, 2, sizeof(cpu_set_t), (unsigned long *)&cpus, RISCV_HWPROBE_WHICH_CPUS); in main()
139 ksft_test_result(rc == 0 && CPU_COUNT(&cpus) == sysconf(_SC_NPROCESSORS_ONLN), "set all cpus\n"); in main()
143 memcpy(&cpus, &cpus_aff, sizeof(cpu_set_t)); in main()
144 rc = riscv_hwprobe(pairs, 2, sizeof(cpu_set_t), (unsigned long *)&cpus, RISCV_HWPROBE_WHICH_CPUS); in main()
145 ksft_test_result(rc == 0 && CPU_EQUAL(&cpus, &cpus_aff), "set all affinity cpus\n"); in main()
149 memcpy(&cpus, &cpus_aff, sizeof(cpu_set_t)); in main()
150 rc = riscv_hwprobe(pairs, 2, sizeof(cpu_set_t), (unsigned long *)&cpus, RISCV_HWPROBE_WHICH_CPUS); in main()
151 ksft_test_result(rc == 0 && CPU_COUNT(&cpus) == 0, "clear all cpus\n"); in main()