Commit a4979505 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

ringtest: support test specific parameters

Add a new flag for passing test-specific parameters.
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent fb9de970
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
int runcycles = 10000000; int runcycles = 10000000;
int max_outstanding = INT_MAX; int max_outstanding = INT_MAX;
int batch = 1; int batch = 1;
int param = 0;
bool do_sleep = false; bool do_sleep = false;
bool do_relax = false; bool do_relax = false;
...@@ -246,6 +247,11 @@ static const struct option longopts[] = { ...@@ -246,6 +247,11 @@ static const struct option longopts[] = {
.has_arg = required_argument, .has_arg = required_argument,
.val = 'b', .val = 'b',
}, },
{
.name = "param",
.has_arg = required_argument,
.val = 'p',
},
{ {
.name = "sleep", .name = "sleep",
.has_arg = no_argument, .has_arg = no_argument,
...@@ -274,6 +280,7 @@ static void help(void) ...@@ -274,6 +280,7 @@ static void help(void)
" [--run-cycles C (default: %d)]" " [--run-cycles C (default: %d)]"
" [--batch b]" " [--batch b]"
" [--outstanding o]" " [--outstanding o]"
" [--param p]"
" [--sleep]" " [--sleep]"
" [--relax]" " [--relax]"
" [--exit]" " [--exit]"
...@@ -328,6 +335,12 @@ int main(int argc, char **argv) ...@@ -328,6 +335,12 @@ int main(int argc, char **argv)
assert(c > 0 && c < INT_MAX); assert(c > 0 && c < INT_MAX);
max_outstanding = c; max_outstanding = c;
break; break;
case 'p':
c = strtol(optarg, &endptr, 0);
assert(!*endptr);
assert(c > 0 && c < INT_MAX);
param = c;
break;
case 'b': case 'b':
c = strtol(optarg, &endptr, 0); c = strtol(optarg, &endptr, 0);
assert(!*endptr); assert(!*endptr);
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <stdbool.h> #include <stdbool.h>
extern int param;
extern bool do_exit; extern bool do_exit;
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment