NetBSD/usr.bin/fincore/fincore.1

116 lines
3.8 KiB
Groff

.\" $NetBSD: fincore.1,v 1.3 2012/01/04 16:18:11 yamt Exp $
.\"
.\" Copyright (c)2011,2012 YAMAMOTO Takashi,
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" ------------------------------------------------------------
.Dd January 5, 2012
.Dt FINCORE 1
.Os
.\" ------------------------------------------------------------
.Sh NAME
.Nm fincore
.Nd query in-core status of file pages
.\" ------------------------------------------------------------
.Sh SYNOPSIS
.Nm
.Op Fl qs
.Ar file ...
.\" ------------------------------------------------------------
.Sh DESCRIPTION
The
.Nm
utility queries and displays in-core status of specified files.
.Pp
Note that the result can already be stale when being output due to other
activities in the system.
Thus it should be used only for advisory purposes.
.Pp
The
.Nm
utility accepts the following options.
.Bl -tag -width hogehoge
.It Fl q
The quiet mode.
Outputs nothing unless the file has in-core pages.
.It Fl s
The summary mode.
Only shows number of pages.
.El
.\" ------------------------------------------------------------
.Sh EXAMPLES
The following example shows that
.Pa /bin/cat
and
.Pa /bin/cp
are fully cached in-core
while the other executables are not in-core.
numbers shown in the default output are page indexes in the file of
each in-core pages.
.Bd -literal
% fincore /bin/c*
/bin/cat: 0 1 2 3
/bin/chio:
/bin/chmod:
/bin/cp: 0 1 2 3 4 5
/bin/cpio:
/bin/csh:
% fincore -s /bin/c*
/bin/cat: 4 / 4 in-core pages (100.00%)
/bin/chio: 0 / 5 in-core pages (0.00%)
/bin/chmod: 0 / 3 in-core pages (0.00%)
/bin/cp: 6 / 6 in-core pages (100.00%)
/bin/cpio: 0 / 36 in-core pages (0.00%)
/bin/csh: 0 / 41 in-core pages (0.00%)
.Ed
.\" ------------------------------------------------------------
.\".Sh HISTORY
.\"The
.\".Nm
.\"utility first appeared in
.\".Nx XXX .
.\" ------------------------------------------------------------
.Sh SEE ALSO
.Xr mincore 2
.\" ------------------------------------------------------------
.Sh AUTHORS
The
.Nm
utility is written by
.An YAMAMOTO Takashi .
.\" ------------------------------------------------------------
.Sh CAVEATS
The concept of page cache is an implementation detail of the kernel.
The
.Nm
utility works using some assumptions on the current implementation.
Thus it might stop working in a future version of
.Nx .
.\" ------------------------------------------------------------
.Sh BUGS
The amount of CPU time the current implementation of
.Nm
utility would take is roughly proportional to the file sizes.
Ideally it should be proportional to the number of in-core pages.