1.\" Copyright (c) 2017 The DragonFly Project. All rights reserved. 2.\" 3.\" This code is derived from software contributed to The DragonFly Project 4.\" by Matthew Dillon <dillon@backplane.com> 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.\" 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in 14.\" the documentation and/or other materials provided with the 15.\" distribution. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 20.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 21.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 22.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 23.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 25.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 27.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.Dd July 29, 2017 31.Dt KCOLLECT 8 32.Os 33.Sh NAME 34.Nm kcollect 35.Nd extract kernel-collected statistics 36.Sh SYNOPSIS 37.Nm 38.Op Fl o Ar fields 39.Op Fl b Ar file 40.Op Fl d Ar file 41.Op Fl r Ar file 42.Op Fl f 43.Op Fl l 44.Op Fl g 45.Op Fl s 46.Op Fl t Ar time 47.Op Fl G 48.Op Fl W Ar width 49.Op Fl H Ar height 50.Op Fl w Ar plotfile 51.Op Fl x Ar gnuplot_options 52.Sh DESCRIPTION 53The 54.Nm 55utility extracts regularly collected statistics accumulated by the kernel. 56The kernel typically keeps around 23 hours worth of statistics. 57If no specific output option is specified, a human-readable text dump 58of the accumulated statistics will be output starting with the most recent 59collection and then going back in time. 60.Pp 61The following options are available: 62.Bl -tag -width indent 63.It Fl o Ar fields 64Indicate which fields to extract. If not specified, all available 65fields are extracted. Unknown fields are ignored. Note that not 66all commands will filter based on the field list. 67.Pp 68You may specify space or comma-separated fieldnames. Whitespace is 69ignored. Use the 70.Fl l 71option to get a list of available fields. 72.It Fl b Ar file 73Dump the data to a dbm database, creating the database if necessary. 74Data is indexed by gmt time, which will be calculated from the ticks. 75Duplicate tuples are ignored. The database will retain data from prior 76runs. 77.It Fl d Ar file 78Load the data from a dbm database instead of loading the active data 79from the current machine. 80.It Fl r Ar file 81This will overwrite headers stored in the specified dbm database with the 82in-memory headers. This can be used to renormalize saved historical dbm 83files when machine specs change, or if the dbm is somehow missing the 84header fields. 85.It Fl g 86Generate gnuplot output for the data. 87.It Fl s 88Smooth plot output (only applicable to gnuplot). 89This may make it more readable. Data is smoothed using an exponential 90average over 10 samples (~100 seconds). 91.It Fl t Ar time 92Specify the number of seconds worth of recent data to extract. 93The 'm', 'h', and 'd' suffixes can be used to specify the value in minutes, 94hours, or days. 95.It Fl x 96Generate gnuplot output for the data and pipe it to gnuplot for display 97to X11. 98.It Fl l 99List all available fields and the field format 100.It Fl f 101Dump available output then enter a 60-second sleep/collection loop 102to incrementally collect and output more data. 103If outputting to gnuplot, the plot will be updated regularly. However, 104please note that this is fairly expensive since the plot data has to 105be completely re-sent to gnuplot on each update. 106.It Fl w Ar plotfile 107Generate gnuplot output to a .png or .jpg file, depending on the extension 108of the filename you supply. 109.It Fl G 110Timestamps for text output will be in GMT instead of localtime. 111.It Fl W Ar width 112.It Fl H Ar height 113Set the width and height of the output plot for the plotfile or for X. 114The default is 512x512. 115.El 116.Sh SEE ALSO 117.Xr systat 1 118.Sh HISTORY 119A 120.Nm 121utility appeared in 122.Dx 4.9 . 123