aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio G. Cota <cota@braap.org>2018-08-15 11:43:44 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2018-08-23 18:46:25 +0200
commit9d5cff3df5620c7e02bdefa06d748a5cfc57f3b6 (patch)
tree2b1aa8e34155a2c5c05d6c7c7801b9b9623a43b6
parentcb764d06650da5fad7c833975b255d08e91a0a52 (diff)
downloadqemu-9d5cff3df5620c7e02bdefa06d748a5cfc57f3b6.zip
qemu-9d5cff3df5620c7e02bdefa06d748a5cfc57f3b6.tar.gz
qemu-9d5cff3df5620c7e02bdefa06d748a5cfc57f3b6.tar.bz2
tests/atomic_add-bench: add -p to enable sync profiler
When used together with -m, this allows us to benchmark the profiler's performance impact on qemu_mutex_lock. Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--tests/atomic_add-bench.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/atomic_add-bench.c b/tests/atomic_add-bench.c
index f96d448..2f6c72f 100644
--- a/tests/atomic_add-bench.c
+++ b/tests/atomic_add-bench.c
@@ -26,6 +26,7 @@ static bool test_stop;
static const char commands_string[] =
" -n = number of threads\n"
" -m = use mutexes instead of atomic increments\n"
+ " -p = enable sync profiler\n"
" -d = duration in seconds\n"
" -r = range (will be rounded up to pow2)";
@@ -143,7 +144,7 @@ static void parse_args(int argc, char *argv[])
int c;
for (;;) {
- c = getopt(argc, argv, "hd:n:mr:");
+ c = getopt(argc, argv, "hd:n:mpr:");
if (c < 0) {
break;
}
@@ -160,6 +161,9 @@ static void parse_args(int argc, char *argv[])
case 'm':
use_mutex = true;
break;
+ case 'p':
+ qsp_enable();
+ break;
case 'r':
range = pow2ceil(atoi(optarg));
break;