summaryrefslogtreecommitdiff
path: root/usr.bin/systat
AgeCommit message (Collapse)Author
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@
2017-01-21The POSIX APIs that that sockaddrs all ignore the s*_len field in thePhilip Guenther
incoming socket, so userspace doesn't need to set it unless it has its own reasons for tracking the size along with the sockaddr. ok phessler@ deraadt@ florian@
2016-12-18Remove statements that have no effect from X(), Y() and Z() #define's.Kenneth R Westerback
Leftovers from the re-engining of systat eight years ago. Makes gcc quieter. ok otto@ deraadt@
2016-12-18increase width of interface column in the pf rules view by 2 chars, so that ↵Jasper Lievisse Adriaanse
'vetherXY' fits ok deraadt@ mpi@
2016-10-13tweak previous; hostname is alredy available plus some better formattingOtto Moerbeek
in case line numbers and/or PAUSED is shown; ok tedu@
2016-10-13add the hostname to the display. started by otto, then deraadt. ok deraadtTed Unangst
2016-08-26Pull in <time.h> for time()Philip Guenther
ok deraadt@
2016-08-24Convert quad_t to int64_t and %q to %llPhilip Guenther
Convert bzero() to memset() and bcopy() to memcpy() ok natano@ millert@
2016-04-13remove dumpfilter related code; it's a leftover from pftop-proper and not usedJasper Lievisse Adriaanse
in systat ok canacar@
2016-04-04Add sys/queue.h where it's needed. Unbreak userland following recentStuart Henderson
removal from mbuf.h. ok mpi@
2016-03-12Use 12 chars for pool name in "systat pool" to match vmstat -m. ok stefan@Stuart Henderson
2016-01-16fix a number of minor issues in the state view:Can Erkin Acar
1. peak and rate computations were using uint32 size which caused the fields from working for states that transferred more than 4GB also fix an unnecessary cast to double found while looking for the bug. 2. When creating new cache entries for existing states, start time from 0 rather than the current time to prevent a "spike" in rate and peak.
2016-01-02make sure debug will be initialized, choose "unknown" (because pfctlSebastian Benoit
loglevel_to_string() uses "unknown" as well) ok kettenis@ florian@
2016-01-02garbage collect unused variable tmSebastian Benoit
ok kettenis@ florian@
2016-01-02remove unused variable cur. code probably c&p from print_bar_title().Sebastian Benoit
remove useless decleration of variable change. ok kettenis@ florian@
2016-01-02garbage collect unsused variableSebastian Benoit
found by evh -AT- riseup -DOT- net, ok florian@