tuxload - Minor modifications.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Fri, 10 Aug 2012 08:42:07 +0000 (10:42 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Fri, 10 Aug 2012 08:42:55 +0000 (10:42 +0200)
- Add some output.
- First create the files, then mmap() them

test/stress/tuxload.c

index 54b8943..522b93d 100644 (file)
@@ -41,10 +41,17 @@ main(int argc, char *argv[])
                                err(1, "open");
                        randomfill(fd[i]);
                }
                                err(1, "open");
                        randomfill(fd[i]);
                }
-
                 if ((fstat(fd[i], &st[i])) == -1)
                 if ((fstat(fd[i], &st[i])) == -1)
-                        err(1, "fstat");
+                       err(1, "fstat");
+               fprintf(stdout, "\rFile creation, random data filled [%d/%d] ", i+1, NFILES);
+               fflush(stdout);
+       }
+
+       printf("\n");
 
 
+        for (i = 0; i <  NFILES; i++) {
+               fflush(stdout);
+               fprintf(stdout, "\rDoing mmap() + msync() [%d/%d] ", i+1, NFILES);
                 size = st[i].st_size;
                 p[i] = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd[i], 0);
                 if (p[i] == MAP_FAILED)
                 size = st[i].st_size;
                 p[i] = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd[i], 0);
                 if (p[i] == MAP_FAILED)