summaryrefslogtreecommitdiff
path: root/usr.bin/systat
AgeCommit message (Collapse)Author
2021-10-25Zap unused variables/functions under /usr/src/*bin/Klemens Nanni
OK deraadt
2021-08-14Fix iostat per-device values when in boot time mode ('b').Todd C. Miller
The values should be displayed as-is and not normalized based on the sleep interval. From Anindya Mukherjee
2021-07-12Change the error reporting pattern throughout the tree when unveilBob Beck
fails to report the path that the failure occured on. Suggested by deraadt@ after some tech discussion. Work done and verified by Ashton Fagg <ashton@fagg.id.au> ok deraadt@ semarie@ claudio@
2021-07-02Use nanosleep() and setitimer() instead of usleep() and ualarm().Todd C. Miller
Both usleep() and ualarm() are obsolete and were removed from POSIX. OK deraadt@
2021-06-02Make the hints at the bottom row sticky by turning the knobs toggles.Martijn van Duren
Specifically this effects ^G, help and order. While here also document the 'h' character. Initial inspiration and diff from Anindya Mukherjee (anindya49 <at> hotmail <dot> com) OK bluhm@
2021-02-06Use message_set() instead of direct assignment to curr_messageTheo Buehler
to avoid leaking the current help text. from Anindya Mukherjee
2021-01-30Fix delay parsing by stealing from strtonum and returning a proper error toMartijn van Duren
the user when an invalid value is entered instead of silently falling back to the default 5s. While here I also capped the upper limit to UINT32_MAX / 1000000 to prevent useconds_t overflow. This hard limits us to 4294s, instead of the current soft limit which just make systat go berserk if you go over it. Reported and original diff by Nick Gasson nick <at> nickg <dot> me <dot> uk OK cheloha@ Tweaks and OK bluhm@
2021-01-18Move defiition of sum variable from header file to avoid issues withmortimer
-fno-common ok deraadt@
2021-01-09kill trailing whitespaceJasper Lievisse Adriaanse
2020-12-22print all the rings on a nic without limiting it to the number of mclpoolsDavid Gwynne
"makes sense" jmatthew@
2020-09-14pf: Merge NOTES column into NAME columnkn
NOTES stays unused unless pf.conf(5) contains "set loginterface ..." in which case it merely amends what can otherwise be part of the NAME column. Merge the constant NOTES values for conditional counters into their NAME values to make the "pf" view look a little nicer and less empty by default; this also saves screen estate for possible future changes, e.g. we could increase column widths. OK tobhe
2020-07-15POWE9 CPUs provide an energy sensor that accumulates the emount of energyMark Kettenis
used by the processor chip. Although we have a SENSOR_WATTHOUR sensor type its units are not really suitable for this sensor. So add a SENSOR_ENERGY type that uses micro Joules as its unit. ok deraadt@
2020-06-22Document "s" commandkn
OK jmc
2020-06-22Remove ^Z mentionkn
Suspending systat with ^Z is done by the shell iff job control is enabled, not systat itself. Try "set +m" to disable job control or start systat in a terminal without a shell, e.g. "xterm -e systat", to confirm ^Z doing nothing in these cases. OK jmc
2020-06-15print the name of the rings in systat mbuf output too.David Gwynne
useful if you're looking at a nic with a lot of different rings.
2020-05-15pf(4): use CLOCK_BOOTTIME to get time_uptime(9) in userspacecheloha
In pf(4), the pf_status.since timestamp is set with time_uptime(9). This is a low-res snapshot of nanouptime(9). nanouptime(9) is used to implement CLOCK_BOOTTIME for clock_gettime(2). It is not used to implement CLOCK_UPTIME, though. The names are misleading. Switch to CLOCK_BOOTTIME in places in userspace where we use pf_status.since so we are working with the right clock. Technically CLOCK_MONOTONIC is equivalent, but we shouldn't use that here. CLOCK_MONOTONIC is not necessarily the "time since boot": the standard says its absolute value is meaningless. ok patrick@ bluhm@
2020-04-23Document uvmexp.nswget without relying on implementation details.Martin Pieuchot
Prompted by a question from schwarze@ ok deraadt@, schwarze@, visa@
2020-04-22mark up a function name with .Fn;Ingo Schwarze
found with mandoc -Tlint
2020-04-22correct the description of the top line;Ingo Schwarze
patch from <clematis at insiberia dot net>
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@