summaryrefslogtreecommitdiff
path: root/crc
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-02-07 20:54:39 -0700
committerJens Axboe <axboe@fb.com>2014-02-07 20:54:39 -0700
commit782744ef60b7ed47a529d30b9f8e0c528c436fdb (patch)
tree989329e7f9e864d37065fbfc1323bd3fcb419bdc /crc
parentf754086950c511d48af21aee5c49e9d7985d3d32 (diff)
crc: add option to list possible crc types
=help or =list will show them. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'crc')
-rw-r--r--crc/test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/crc/test.c b/crc/test.c
index 5812b35..2f6d9ee 100644
--- a/crc/test.c
+++ b/crc/test.c
@@ -306,6 +306,16 @@ static unsigned int get_test_mask(const char *type)
return mask;
}
+static int list_types(void)
+{
+ int i;
+
+ for (i = 0; t[i].name; i++)
+ printf("%s\n", t[i].name);
+
+ return 0;
+}
+
int fio_crctest(const char *type)
{
unsigned int test_mask = 0;
@@ -316,6 +326,8 @@ int fio_crctest(const char *type)
if (!type)
test_mask = ~0U;
+ else if (!strcmp(type, "help") || !strcmp(type, "list"))
+ return list_types();
else
test_mask = get_test_mask(type);
@@ -331,5 +343,6 @@ int fio_crctest(const char *type)
mb_sec /= (1.024 * 1.024);
printf("%s:\t%.2f MB/sec\n", t[i].name, mb_sec);
}
+
return 0;
}