summaryrefslogtreecommitdiff
path: root/usr.bin/systat
AgeCommit message (Collapse)Author
2020-01-16Usually, -width Fl (which is 10n) is too wide and hence ugly.Ingo Schwarze
Change several instances, most of them to the usual -width Ds.
2020-01-12Add support for human readable numbers where applicable.Martijn van Duren
OK stsp@ and bluhm@
2019-11-28ks_mapblocks is gonePhilip Guenther
2019-10-17Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX.Todd C. Miller
This is the userland portion. OK deraadt@ sashan@
2019-10-14pledge() won't work but we can use unveil() to reduce filesystem accessTheo de Raadt
in these 3 related programs (they borrow parts of each other using .PATH) Hopefully no regressions, ktrace checks by myself and mestre
2019-07-19Make systat flushing output after a page display in rawmode (flags -b or -B)solene
ok millert@ kurt@ code suggested by otto@
2019-07-04set ierrs and oerrs titles when changing fails/drops/errs, not ierrs twiceDavid Gwynne
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-05-09Use the new sysctl to print systat pf 1. This now works even for unprivedClaudio Jeker
users. OK deraadt@, sashan@
2019-05-08allow switching to print stats since boot via 'b'.Ted Unangst
ok beck deraadt
2019-03-04expose the interface queue drops in the interface viewDavid Gwynne
by default qdrops and errors are combined in a number of failures. the qdrops and errors can be viewed separately by using 'd' and 'e' respectively, or the combined view again with 'f'. ok claudio@ deraadt@
2019-03-04make title a const char *.David Gwynne
2019-02-18Change ps_len of struct pfioc_states and psn_len of structAlexander Bluhm
pfioc_src_nodes to size_t. This avoids integer truncation by casts to unsigned. As the types of DIOCGETSTATES and DIOCGETSRCNODES ioctl(2) arguments change, pfctl(8) and systat(1) should be updated together with the kernel. Calculate number of pf(4) states as size_t in userland. OK sashan@ deraadt@
2019-01-20don't reuse global between functions; the value is wrong.Ted Unangst
reported by Bryan Linton
2019-01-17use $OpenBSD markersTed Unangst
ok millert mpi
2018-12-10Add a velocity sensor type (displayed as m/s)Landry Breuil
Change distance sensor type to be displayed as meters with 3 decimals instead of millimeters. ok mpi@ kettenis@
2018-11-17Add new KERN_CPUSTATS sysctl(2) so we can identify offline CPUs.cheloha
Because of hw.smt we need a way to determine whether a given CPU is "online" or "offline" from userspace. KERN_CPTIME2 is an array, and so cannot be cleanly extended for this purpose, so add a new sysctl(2) KERN_CPUSTATS with an extensible struct. At the moment it's just KERN_CPTIME2 with a flags member, but it can grow as needed. KERN_CPUSTATS appears to have been defined by BSDi long ago, but there are few (if any) packages in the wild still using the symbol so breakage in ports should be near zero. No other system inherited the symbol from BSDi, either. Then, use the new sysctl(2) in systat(1) and top(1): - systat(1) draws placeholder marks ('-') instead of percentages for offline CPUs in the cpu view. - systat(1) omits offline CPU ticks when drawing the "big bar" in the vmstat view. The upshot is that the bar isn't half idle when half your logical CPUs are disabled. - top(1) does not draw lines for offline CPUs; if CPUs toggle on or offline in interactive mode we redraw the display to expand/reduce space for the new/missing CPUs. This is consistent with what some top(1) implementations do on Linux. - top(1) omits offline CPUs from the totals when CPU totals are combined into a single line (the '-1' flag). Originally prompted by deraadt@. Discussed endlessly with deraadt@, ketennis@, and sthen@. Tested by jmc@ and jca@. Earlier versions also discussed with jca@. Earlier versions tested by jmc@, tb@, and many others. docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@, "Is your stuff in yet?" deraadt@
2018-10-05Revert KERN_CPTIME2 ENODEV changes in kernel and userspace.cheloha
ok kettenis deraadt
2018-09-26KERN_CPTIME2: set ENODEV if the CPU is offline.cheloha
This lets userspace distinguish between idle CPUs and those that are not schedulable because hw.smt=0. A subsequent commit probably needs to add documentation for this to sysctl.2 (and perhaps elsewhere) after the dust settles. Also included here are changes to systat(1) and top(1) that account for the ENODEV case and adjust behavior accordingly: - systat(1)'s cpu view prints placeholder marks ('-') instead of percentages for each state if the given CPU is offline. - systat(1)'s vmstat view checks for offline CPUs when computing the machine state total and excludes them, so the CPU usage graph only represents the states for online CPUs. - top(1) does not draw CPU rows for offline CPUs when the view is redrawn. If CPUs "go offline", percentages for each state are replaced by placeholder marks ('-'); the view will need to be redrawn to remove these rows. If CPUs "go online" the view will need to be redrawn to show these new CPUs. In "combined CPU" mode, the count and the state totals only represent online CPUs. Ports using KERN_CPTIME2 will need to be updated. The changes described above to make systat(1) and top(1) aware of the ENODEV case *and* gracefully handle a changing HW_NCPUONLINE while the application is running are not necessarily appropriate for each and every port. The changes described above are so extensive in part to demonstrate one way a program *might* be made robust to changing CPU availability. In particular, changing hw.smt after boot is an extremely rare event, and this needs to be weighed when updating ports. The logic needed to account for the KERN_CPTIME2 ENODEV case is very roughly: if (sysctl(...) == -1) { if (errno != ENODEV) { /* Actual error occurred. */ } else { /* CPU is offline. */ } } else { /* CPU is online and CPU states were set by sysctl(2). */ } Prompted by deraadt@. Basic idea for ENODEV from kettenis@. Discussed at length with kettenis@. Additional testing by tb@. No complaints from hackers@ after a week. ok kettenis@, "I think you should commit [now]" deraadt@
2018-09-13Fix warnings caused by user_from_uid() and group_from_gid() nowTodd C. Miller
returning const char *.
2018-09-07Remove unnused af argument from unmask(), sync with pfctlkn
Noted by jca, thanks. OK jca claudio
2018-07-25Document the spinning time of the CPU in systat(1) and top(1).Alexander Bluhm
from Marcus MERIGHI; OK deraadt@ jmc@
2018-07-08iostat shows data in bytes, not kilobytes;Jason McIntyre
from marcus merighi ok benno
2018-06-22Constrain IPKTS/OPKTS from floating down beyond the rest of theKenneth R Westerback
displayed lines. Makes vmstat view in tall windows easier to read. ok sthen@
2018-06-21Shuffle fields around to eliminate blanks spots resulting fromKenneth R Westerback
removing unused uvmexp fields. Reduces number of lines as well.
2018-06-20Remove unused variable. Make clang happier.Kenneth R Westerback
2018-06-19Rename some unused fields in struct uvmexp toKenneth R Westerback
unusedNN. Missing man page bits pointed out by jmc@. Ports source scan by sthen@. ok deraadt@ guenther@
2018-06-01Avoid some unnecessary calls to strlen(3) in systat uvm.Alexander Bluhm
OK krw@
2018-05-30tweak previous;Jason McIntyre
2018-05-30Add uvm view to show all values being collected in uvmexp.Kenneth R Westerback
Feedbacks, tweaks, ok bluhm@
2018-05-19Do not ignore nice time in systat(1). The sum would not be 100%,Alexander Bluhm
a busy machine would look idle. As %Nic does not fit in the columns, add it to %Usr. Introduce @ for spinning time to keep the characters people are used to. Put %Spn between %Int and %Sys like in top. OK visa@ mpi@
2018-05-14Stopping counting and reporting CPU time spent spinning on a lock asMartin Pieuchot
system time. Introduce a new CP_SPIN "scheduler state" and modify userland tools to display the % of timer a CPU spents spinning. Based on a diff from jmatthew@, ok pirofti@, bluhm@, visa@, deraadt@
2018-05-03test for failing allocation using the standard idiom; prompted by Nan XiaoOtto Moerbeek
ok tb@
2018-02-11Make sorting in the pcache view work. This allows us to sort on allMartijn van Duren
shown columns. There's still parts that could do with a good polishing, but it's an improvement. OK tedu@
2018-02-08Make pool order on size actually order on size instead of size*inuse.Martijn van Duren
Prompted by and OK otto@
2018-02-08Add the order keyword to systat global command interpreter.Martijn van Duren
This command shows the available orderings for the current view, which ordering is active, their shortcuts, and if they're in reverse order. manpage nits jmc@ OK tedu@
2017-07-31print the number of GCs with print_fld_size instead of print_fld_uint.David Gwynne
this makes a large number of GCs appear as something like "26K" instead of "*".
2017-07-29return -1 in error path of non-void function, pointed out by clangFlorian Obser
OK deraadt
2017-07-19Allow HFSC classes to use flow queuesMike Belopuhov
The FQ-CoDel related configuration (flows, quantum) becomes available for the regular bandwidth queue. Internally the kernel will pick the FQ-CoDel for use as a queue manager for the specified class instead of the FIFO. Discussed with and OK henning@ at d2k17 as a part of a larger diff.
2017-06-23change the semantic for calculating when to grow the size of a cache list.David Gwynne
previously it would figure out if there's enough items overall for all the cpus to have full active an inactive free lists. this included currently allocated items, which pools wont actually hold on a free list and cannot predict when they will come back. instead, see if there's enough items in the idle lists in the depot that could instead go on all the free lists on the cpus. if there's enough idle items, then we can grow. tested by hrvoje popovski and amit kulkarni ok visa@
2017-06-15add a rough start to a pcache view, to show pool cpu cache info.David Gwynne
ok mikeb@ millert@
2017-06-01Return time_uptime as value for when pf was enabled instead ofPatrick Wildt
time_second. Since time_second changes depending on the wall- clock time, time_second is not a reliable source for the status. We can even end up with a negative time delta. Thus, use the monotonically growing time_uptime and export it to userland. ok bluhm@ mikeb@
2017-05-22Support for displaying flow queues alongside H-FSCMike Belopuhov
This (ab)uses the fact that node->qstats.data.period field in hfsc_class_stats structure is at the same offset as the 'flows' field in fqcodel_stats. While here make use of a presently empty field "SCH" to display the queue management policy (flow or fifo) which is not strictly a scheduler, but it will hopefully become descriptive and useful later. This distinguishes flow queues from the regular HFSC ones. OK sthen, visa
2017-05-16Improve the precision of displayed bandwidth valuesMike Belopuhov
Carl Mascott has reported the issue and helped with the fix. OK tb
2017-05-03Remove unused PRIO column from the queueing display; ok sthen@Mike Belopuhov
2017-04-26Perform H-FSC root queue allocation in the kernelMike Belopuhov
Since only leaf queues can have packets assigned to them, H-FSC requires the user specified root queue to have a parent. To simplify userland tools and the configuration interface, the kernel can be leveraged to set it up. ok henning
2017-04-16Statistics for high memory flips in the buffer cacheBob Beck
nits from deraadt@ ok krw@ guenther@ kettenis@
2017-04-05Clamp size to length if snprintf ever indicates overflowTheo de Raadt
w/ millert
2017-04-05an annoying whitespace glitchTheo de Raadt
2017-04-02Make dma range buffer cache pages visible in systat ioBob Beck
ok deraadt@