diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-23 03:15:43 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2020-07-07 00:47:24 +0300 |
commit | ce32659b3673767cd92c4919d4000aa0dc056c1c (patch) | |
tree | 5c8b0647c32cad550bb46f30664661070eedd6d0 | |
parent | b85d387c9b091953d5e8ac4c72af6747c1a554e3 (diff) | |
download | linux-ce32659b3673767cd92c4919d4000aa0dc056c1c.tar.xz |
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 <pbonzini@redhat.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
-rw-r--r-- | tools/testing/selftests/breakpoints/step_after_suspend_test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/breakpoints/step_after_suspend_test.c b/tools/testing/selftests/breakpoints/step_after_suspend_test.c index b3ead29c6089..983ee6182e25 100644 --- a/tools/testing/selftests/breakpoints/step_after_suspend_test.c +++ b/tools/testing/selftests/breakpoints/step_after_suspend_test.c @@ -183,6 +183,10 @@ int main(int argc, char **argv) } } + err = sched_getaffinity(0, sizeof(available_cpus), &available_cpus); + if (err < 0) + ksft_exit_fail_msg("sched_getaffinity() failed\n"); + for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { if (!CPU_ISSET(cpu, &available_cpus)) continue; @@ -193,10 +197,6 @@ int main(int argc, char **argv) if (do_suspend) suspend(); - err = sched_getaffinity(0, sizeof(available_cpus), &available_cpus); - if (err < 0) - ksft_exit_fail_msg("sched_getaffinity() failed\n"); - for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { bool test_success; |