Skip to content

Commit ce32659

Browse files
bonzinishuahkh
authored andcommitted
selftests: breakpoints: fix computation of test plan
The computation of the test plan uses the available_cpus bitset before calling sched_getaffinity to fill it in. The resulting plan is bogus, fix it. Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent b85d387 commit ce32659

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/testing/selftests/breakpoints/step_after_suspend_test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ int main(int argc, char **argv)
183183
}
184184
}
185185

186+
err = sched_getaffinity(0, sizeof(available_cpus), &available_cpus);
187+
if (err < 0)
188+
ksft_exit_fail_msg("sched_getaffinity() failed\n");
189+
186190
for (cpu = 0; cpu < CPU_SETSIZE; cpu++) {
187191
if (!CPU_ISSET(cpu, &available_cpus))
188192
continue;
@@ -193,10 +197,6 @@ int main(int argc, char **argv)
193197
if (do_suspend)
194198
suspend();
195199

196-
err = sched_getaffinity(0, sizeof(available_cpus), &available_cpus);
197-
if (err < 0)
198-
ksft_exit_fail_msg("sched_getaffinity() failed\n");
199-
200200
for (cpu = 0; cpu < CPU_SETSIZE; cpu++) {
201201
bool test_success;
202202

0 commit comments

Comments
 (0)