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 23, 2019 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 O Ar format 40.Op Fl b Ar file 41.Op Fl d Ar file 42.Op Fl r Ar file 43.Op Fl f 44.Op Fl F 45.Op Fl l 46.Op Fl g 47.Op Fl s 48.Op Fl t Ar time 49.Op Fl G 50.Op Fl W Ar width 51.Op Fl H Ar height 52.Op Fl w Ar plotfile 53.Op Fl x Ar gnuplot_options 54.Sh DESCRIPTION 55The 56.Nm 57utility extracts regularly collected statistics accumulated by the kernel. 58The kernel typically keeps around 23 hours worth of statistics. 59If no specific output option is specified, a human-readable text dump 60of the accumulated statistics will be output starting with the most recent 61collection and then going back in time. 62.Pp 63The following options are available: 64.Bl -tag -width indent 65.It Fl o Ar fields 66Indicate which fields to extract. 67If not specified, all available fields are extracted. 68Unknown fields are ignored. 69Note that not all commands will filter based on the field list. 70.Pp 71You may specify space or comma-separated fieldnames. 72Whitespace is ignored. 73Use the 74.Fl l 75option to get a list of available fields. 76.It Fl O Ar format 77Specify the desired output format. 78The following output formats are available: 79.Bl -tag -width indent 80.It text 81This is the default. 82It produces a human readable text output. 83.It influxdb 84EXPERIMENTAL. 85It tries to dump the entries in an InfluxDB line protocol compatible format. 86.El 87.It Fl b Ar file 88Dump the data to a dbm database, creating the database if necessary. 89Data is indexed by gmt time, which will be calculated from the ticks. 90Duplicate tuples are ignored. 91The database will retain data from prior runs. 92.It Fl d Ar file 93Load the data from a dbm database instead of loading the active data 94from the current machine. 95.It Fl r Ar file 96This will overwrite headers stored in the specified dbm database with the 97in-memory headers. 98This can be used to renormalize saved historical dbm files when machine specs 99change, or if the dbm is somehow missing the header fields. 100.It Fl g 101Generate gnuplot output for the data. 102.It Fl s 103Smooth plot output (only applicable to gnuplot). 104This may make it more readable. 105Data is smoothed using an exponential average over 10 samples (~100 seconds). 106.It Fl t Ar time 107Specify the number of seconds worth of recent data to extract. 108The 'm', 'h', and 'd' suffixes can be used to specify the value in minutes, 109hours, or days. 110.It Fl x 111Generate gnuplot output for the data and pipe it to gnuplot for display 112to X11. 113.It Fl l 114List all available fields and the field format 115.It Fl f 116Dump available output then enter a 60-second sleep/collection loop 117to incrementally collect and output more data. 118If outputting to gnuplot, the plot will be updated regularly. 119However, please note that this is fairly expensive since the plot data has to 120be completely re-sent to gnuplot on each update. 121.It Fl F 122Same as 123.Fl f 124but do not display the whole buffer at the beginning. 125.It Fl w Ar plotfile 126Generate gnuplot output to a .png or .jpg file, depending on the extension 127of the filename you supply. 128.It Fl G 129Timestamps for text output will be in GMT instead of localtime. 130.It Fl W Ar width 131.It Fl H Ar height 132Set the width and height of the output plot for the plotfile or for X. 133The default is 512x512. 134.El 135.Pp 136The standard 137.Nm 138display shows the following statistics: 139.Pp 140.Bl -tag -width syscalls -compact 141.It load 142system load average 143.It user 144% of total cpu time in user mode 145.It syst 146% of total cpu time in system mode 147.It idle 148% of total cpu time in idle mode 149.It swapuse 150% of total swap space used 151.It swapano 152total amount of anonymous swap used in MB 153.It swapcac 154total amount of swapcache in MB 155.It fault 156total amount of vm faults including both zero-fill and cow faults 157.It cow 158total amount of copy-on-write faults 159.It zfill 160total amount of zero-fill faults 161.It free 162amount of free memory in bytes 163.It cache 164amount of almost free memory in bytes 165.It inact 166amount of inactive memory in bytes 167.It act 168amount of active memory in bytes 169.It wired 170amount of wired/kernel memory in bytes 171.It syscalls 172total amount of system calls 173.It nlookup 174total amount of path lookups 175.It intr 176total amount of nominal external interrupts 177.It ipi 178total amount of inter-cpu interrupts 179.It timer 180total amount of timer interrupts 181.El 182.Pp 183The output fields in bytes are typically converted with 184.Xr humanize_number 3 185before displaying, at least for the default output format. 186.Sh SEE ALSO 187.Xr systat 1 188.Sh HISTORY 189A 190.Nm 191utility appeared in 192.Dx 4.9 . 193