Skip to content

Commit 9d5cff3

Browse files
cotabonzini
authored andcommitted
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 <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent cb764d0 commit 9d5cff3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/atomic_add-bench.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static bool test_stop;
2626
static const char commands_string[] =
2727
" -n = number of threads\n"
2828
" -m = use mutexes instead of atomic increments\n"
29+
" -p = enable sync profiler\n"
2930
" -d = duration in seconds\n"
3031
" -r = range (will be rounded up to pow2)";
3132

@@ -143,7 +144,7 @@ static void parse_args(int argc, char *argv[])
143144
int c;
144145

145146
for (;;) {
146-
c = getopt(argc, argv, "hd:n:mr:");
147+
c = getopt(argc, argv, "hd:n:mpr:");
147148
if (c < 0) {
148149
break;
149150
}
@@ -160,6 +161,9 @@ static void parse_args(int argc, char *argv[])
160161
case 'm':
161162
use_mutex = true;
162163
break;
164+
case 'p':
165+
qsp_enable();
166+
break;
163167
case 'r':
164168
range = pow2ceil(atoi(optarg));
165169
break;

0 commit comments

Comments
 (0)