]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/virtio/ringtest/main.c
Merge tag 'md/4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md
[karo-tx-linux.git] / tools / virtio / ringtest / main.c
index f31353fac5415d8b9f5614e6f46f71a8f062f09b..453ca3c211933d12a5b7933852043f7154434fe6 100644 (file)
@@ -20,6 +20,7 @@
 int runcycles = 10000000;
 int max_outstanding = INT_MAX;
 int batch = 1;
+int param = 0;
 
 bool do_sleep = false;
 bool do_relax = false;
@@ -86,7 +87,7 @@ void set_affinity(const char *arg)
        cpu = strtol(arg, &endptr, 0);
        assert(!*endptr);
 
-       assert(cpu >= 0 || cpu < CPU_SETSIZE);
+       assert(cpu >= 0 && cpu < CPU_SETSIZE);
 
        self = pthread_self();
        CPU_ZERO(&cpuset);
@@ -246,6 +247,11 @@ static const struct option longopts[] = {
                .has_arg = required_argument,
                .val = 'b',
        },
+       {
+               .name = "param",
+               .has_arg = required_argument,
+               .val = 'p',
+       },
        {
                .name = "sleep",
                .has_arg = no_argument,
@@ -274,6 +280,7 @@ static void help(void)
                " [--run-cycles C (default: %d)]"
                " [--batch b]"
                " [--outstanding o]"
+               " [--param p]"
                " [--sleep]"
                " [--relax]"
                " [--exit]"
@@ -328,6 +335,12 @@ int main(int argc, char **argv)
                        assert(c > 0 && c < INT_MAX);
                        max_outstanding = c;
                        break;
+               case 'p':
+                       c = strtol(optarg, &endptr, 0);
+                       assert(!*endptr);
+                       assert(c > 0 && c < INT_MAX);
+                       param = c;
+                       break;
                case 'b':
                        c = strtol(optarg, &endptr, 0);
                        assert(!*endptr);