aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/include/perf_test_util.h
diff options
context:
space:
mode:
authorDavid Matlack <dmatlack@google.com>2021-11-11 00:12:55 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2021-11-16 07:43:28 -0500
commit81bcb26172a8f00840e0ca44277272dcb673887a (patch)
tree0e947a01873939ed8db43983f877914ceaf7a866 /tools/testing/selftests/kvm/include/perf_test_util.h
parentKVM: selftests: Start at iteration 0 instead of -1 (diff)
downloadlinux-dev-81bcb26172a8f00840e0ca44277272dcb673887a.tar.xz
linux-dev-81bcb26172a8f00840e0ca44277272dcb673887a.zip
KVM: selftests: Move vCPU thread creation and joining to common helpers
Move vCPU thread creation and joining to common helper functions. This is in preparation for the next commit which ensures that all vCPU threads are fully created before entering guest mode on any one vCPU. No functional change intended. Signed-off-by: David Matlack <dmatlack@google.com> Reviewed-by: Ben Gardon <bgardon@google.com> Message-Id: <20211111001257.1446428-3-dmatlack@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/perf_test_util.h')
-rw-r--r--tools/testing/selftests/kvm/include/perf_test_util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/perf_test_util.h b/tools/testing/selftests/kvm/include/perf_test_util.h
index 74e3622b3a6e..a86f953d8d36 100644
--- a/tools/testing/selftests/kvm/include/perf_test_util.h
+++ b/tools/testing/selftests/kvm/include/perf_test_util.h
@@ -8,6 +8,8 @@
#ifndef SELFTEST_KVM_PERF_TEST_UTIL_H
#define SELFTEST_KVM_PERF_TEST_UTIL_H
+#include <pthread.h>
+
#include "kvm_util.h"
/* Default guest test virtual memory offset */
@@ -45,4 +47,7 @@ void perf_test_destroy_vm(struct kvm_vm *vm);
void perf_test_set_wr_fract(struct kvm_vm *vm, int wr_fract);
+void perf_test_start_vcpu_threads(int vcpus, void (*vcpu_fn)(struct perf_test_vcpu_args *));
+void perf_test_join_vcpu_threads(int vcpus);
+
#endif /* SELFTEST_KVM_PERF_TEST_UTIL_H */