projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t/io_uring: clarify polled support is fs + device
[fio.git]
/
t
/
lfsr-test.c
diff --git
a/t/lfsr-test.c
b/t/lfsr-test.c
index 4b5424833ffca7ae148a6c696df3f97baaca83e5..ea8c8ddbde9a3429624ddde9cb9615a24c7b8c9b 100644
(file)
--- a/
t/lfsr-test.c
+++ b/
t/lfsr-test.c
@@
-1,17
+1,13
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-#include <time.h>
#include <math.h>
#include <string.h>
#include <math.h>
#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include "../lib/lfsr.h"
#include "../gettime.h"
#include "../fio_time.h"
#include "../lib/lfsr.h"
#include "../gettime.h"
#include "../fio_time.h"
-
void usage(
)
+
static void usage(void
)
{
printf("Usage: lfsr-test 0x<numbers> [seed] [spin] [verify]\n");
printf("-------------------------------------------------------------\n");
{
printf("Usage: lfsr-test 0x<numbers> [seed] [spin] [verify]\n");
printf("-------------------------------------------------------------\n");
@@
-27,7
+23,7
@@
void usage()
int main(int argc, char *argv[])
{
int r;
int main(int argc, char *argv[])
{
int r;
- struct time
val
start, end;
+ struct time
spec
start, end;
struct fio_lfsr *fl;
int verify = 0;
unsigned int spin = 0;
struct fio_lfsr *fl;
int verify = 0;
unsigned int spin = 0;
@@
-38,12
+34,17
@@
int main(int argc, char *argv[])
void *v = NULL, *v_start;
double total, mean;
void *v = NULL, *v_start;
double total, mean;
+ arch_init(argv);
+
/* Read arguments */
switch (argc) {
case 5: if (strncmp(argv[4], "verify", 7) == 0)
/* Read arguments */
switch (argc) {
case 5: if (strncmp(argv[4], "verify", 7) == 0)
- verify = 1;
+ verify = 1;
+ /* fall through */
case 4: spin = atoi(argv[3]);
case 4: spin = atoi(argv[3]);
+ /* fall through */
case 3: seed = atol(argv[2]);
case 3: seed = atol(argv[2]);
+ /* fall through */
case 2: numbers = strtol(argv[1], NULL, 16);
break;
default: usage();
case 2: numbers = strtol(argv[1], NULL, 16);
break;
default: usage();
@@
-78,7
+79,7
@@
int main(int argc, char *argv[])
v_size = numbers * sizeof(uint8_t);
v = malloc(v_size);
memset(v, 0, v_size);
v_size = numbers * sizeof(uint8_t);
v = malloc(v_size);
memset(v, 0, v_size);
- printf("\nVerification table is %lf K
Bs
\n", (double)(v_size) / 1024);
+ printf("\nVerification table is %lf K
iB
\n", (double)(v_size) / 1024);
}
v_start = v;
}
v_start = v;
@@
-89,7
+90,7
@@
int main(int argc, char *argv[])
*/
fprintf(stderr, "\nTest initiated... ");
fio_gettime(&start, NULL);
*/
fprintf(stderr, "\nTest initiated... ");
fio_gettime(&start, NULL);
- while (!lfsr_next(fl, &i
, fl->max_val
)) {
+ while (!lfsr_next(fl, &i)) {
if (verify)
*(uint8_t *)(v + i) += 1;
}
if (verify)
*(uint8_t *)(v + i) += 1;
}
@@
-122,7
+123,7
@@
int main(int argc, char *argv[])
if (verify)
printf("(slower due to verification)");
printf("\n==============================\n");
if (verify)
printf("(slower due to verification)");
printf("\n==============================\n");
- printf("Elapsed: %lf s\n", total / pow(10,
9
));
+ printf("Elapsed: %lf s\n", total / pow(10,
6
));
printf("Mean: %lf us\n", mean);
free(v_start);
printf("Mean: %lf us\n", mean);
free(v_start);