Diskspeed: added extra sync and timeout before each test.

This commit is contained in:
Sergey
2015-02-13 19:41:32 -08:00
parent 5ce8a8cd33
commit 942bdda5ed
3 changed files with 12 additions and 6 deletions

1
src/cmd/.gitignore vendored
View File

@@ -11,6 +11,7 @@ comm
cp
dd
df
diskspeed
du
echo
ed

View File

@@ -33,11 +33,11 @@ SCRIPT = false nohup true #lorder mkdep
# C programs that live in the current directory and do not need
# explicit make lines.
#
STD = basename cal cat cb chgrp chmod cmp col comm cp dd du \
echo ed fgrep file grep head hostid join kill last ln \
mesg mkdir mv nice od pagesize pr printenv pwd rev rm rmail rmdir \
size sleep sort split sum sync tail tar tee time touch tr \
tsort tty uniq w wc whereis who diskspeed
STD = basename cal cat cb chgrp chmod cmp col comm cp dd \
diskspeed du echo ed fgrep file grep head hostid join \
kill last ln mesg mkdir mv nice od pagesize pr printenv \
pwd rev rm rmail rmdir size sleep sort split sum sync \
tail tar tee time touch tr tsort tty uniq w wc whereis who
# C programs that live in the current directory and need explicit make lines.
#

View File

@@ -21,7 +21,6 @@
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <sys/time.h>
#define MAX_BLOCK_SZ 64 /* kbytes */
@@ -153,6 +152,9 @@ int main(int argc, char **argv)
* Write data to file.
*/
sync();
usleep(200000);
sync();
usleep(200000);
t0 = current_msec();
nbytes = blocksize_kbytes * 1024;
for (n=0; n<datasize_mbytes*1024/blocksize_kbytes; n++) {
@@ -170,6 +172,9 @@ int main(int argc, char **argv)
* Read data from file.
*/
sync();
usleep(200000);
sync();
usleep(200000);
lseek(fd, 0, SEEK_SET);
t0 = current_msec();
for (n=0; n<datasize_mbytes*1024/blocksize_kbytes; n++) {