xref: /netbsd-src/usr.bin/fincore/fincore.1 (revision 1f34562751366849106422851cf93ca1311c67e1)
1.\"	$NetBSD: fincore.1,v 1.3 2012/01/04 16:18:11 yamt Exp $
2.\"
3.\" Copyright (c)2011,2012 YAMAMOTO Takashi,
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" ------------------------------------------------------------
28.Dd January 5, 2012
29.Dt FINCORE 1
30.Os
31.\" ------------------------------------------------------------
32.Sh NAME
33.Nm fincore
34.Nd query in-core status of file pages
35.\" ------------------------------------------------------------
36.Sh SYNOPSIS
37.Nm
38.Op Fl qs
39.Ar file ...
40.\" ------------------------------------------------------------
41.Sh DESCRIPTION
42The
43.Nm
44utility queries and displays in-core status of specified files.
45.Pp
46Note that the result can already be stale when being output due to other
47activities in the system.
48Thus it should be used only for advisory purposes.
49.Pp
50The
51.Nm
52utility accepts the following options.
53.Bl -tag -width hogehoge
54.It Fl q
55The quiet mode.
56Outputs nothing unless the file has in-core pages.
57.It Fl s
58The summary mode.
59Only shows number of pages.
60.El
61.\" ------------------------------------------------------------
62.Sh EXAMPLES
63The following example shows that
64.Pa /bin/cat
65and
66.Pa /bin/cp
67are fully cached in-core
68while the other executables are not in-core.
69numbers shown in the default output are page indexes in the file of
70each in-core pages.
71.Bd -literal
72% fincore /bin/c*
73/bin/cat: 0 1 2 3
74/bin/chio:
75/bin/chmod:
76/bin/cp: 0 1 2 3 4 5
77/bin/cpio:
78/bin/csh:
79% fincore -s /bin/c*
80/bin/cat: 4 / 4 in-core pages (100.00%)
81/bin/chio: 0 / 5 in-core pages (0.00%)
82/bin/chmod: 0 / 3 in-core pages (0.00%)
83/bin/cp: 6 / 6 in-core pages (100.00%)
84/bin/cpio: 0 / 36 in-core pages (0.00%)
85/bin/csh: 0 / 41 in-core pages (0.00%)
86.Ed
87.\" ------------------------------------------------------------
88.\".Sh HISTORY
89.\"The
90.\".Nm
91.\"utility first appeared in
92.\".Nx XXX .
93.\" ------------------------------------------------------------
94.Sh SEE ALSO
95.Xr mincore 2
96.\" ------------------------------------------------------------
97.Sh AUTHORS
98The
99.Nm
100utility is written by
101.An YAMAMOTO Takashi .
102.\" ------------------------------------------------------------
103.Sh CAVEATS
104The concept of page cache is an implementation detail of the kernel.
105The
106.Nm
107utility works using some assumptions on the current implementation.
108Thus it might stop working in a future version of
109.Nx .
110.\" ------------------------------------------------------------
111.Sh BUGS
112The amount of CPU time the current implementation of
113.Nm
114utility would take is roughly proportional to the file sizes.
115Ideally it should be proportional to the number of in-core pages.
116