iostats: add -C flag to enable mount cache
This commit is contained in:
parent
3d12f4f408
commit
01b5ac1402
2 changed files with 15 additions and 4 deletions
|
@ -5,8 +5,9 @@ iostats \- file system to measure I/O
|
|||
.B iostats
|
||||
[
|
||||
.B -d
|
||||
]
|
||||
[
|
||||
] [
|
||||
.B -C
|
||||
] [
|
||||
.B -f
|
||||
.I dbfile
|
||||
]
|
||||
|
@ -55,6 +56,12 @@ is written to
|
|||
.I dbfile
|
||||
(default
|
||||
.BR iostats.out ).
|
||||
.PP
|
||||
The
|
||||
.B -C
|
||||
flag sets the MCACHE flag on the mount which allows
|
||||
the kernel to cache (see
|
||||
.IR bind(1) ).
|
||||
.SH EXAMPLE
|
||||
Display summary of file I/O incurred by
|
||||
.IR ls (1):
|
||||
|
|
|
@ -48,8 +48,9 @@ main(int argc, char **argv)
|
|||
char *dbfile, *s;
|
||||
char buf[128];
|
||||
float brpsec, bwpsec, bppsec;
|
||||
int type, cpid, fspid, n;
|
||||
int type, cpid, fspid, n, mflag;
|
||||
|
||||
mflag = MREPL;
|
||||
dbfile = DEBUGFILE;
|
||||
|
||||
ARGBEGIN{
|
||||
|
@ -59,6 +60,9 @@ main(int argc, char **argv)
|
|||
case 'f':
|
||||
dbfile = ARGF();
|
||||
break;
|
||||
case 'C':
|
||||
mflag |= MCACHE;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}ARGEND
|
||||
|
@ -83,7 +87,7 @@ main(int argc, char **argv)
|
|||
fatal("no working directory");
|
||||
|
||||
rfork(RFENVG|RFNAMEG|RFNOTEG);
|
||||
if(mount(p[0], -1, "/", MREPL, "") < 0)
|
||||
if(mount(p[0], -1, "/", mflag, "") < 0)
|
||||
fatal("mount /");
|
||||
|
||||
bind("#c/pid", "/dev/pid", MREPL);
|
||||
|
|
Loading…
Reference in a new issue