Commit Graph

359 Commits

Author SHA1 Message Date
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
uwe e0b356926e systat(1): try to give this page a quick facelift
... too bad what it really needs is reconstructive surgery.  I tried
to fix the most obvious problems (unsorted lists, obviously wrong
markup, pleonastic wording that drowns out useful information in
repetition and lifetime supply of quote marks).

This page really needs a native speaker to take some loving care of it.
2023-03-29 21:44:35 +00:00
kre fffcd3e6b6 PR misc/57305 from Nan Xiao
Be consistent with method (and style) when referring to the mbufs and
ifstat sub-commands when describing what is available (and correct
"mbuf" to be "mbufs" which is what the internal command really is).

That is don't just "double quote" one and 'single quote' the other.
2023-03-29 19:40:18 +00:00
kre ef42ac5b47 PR bin/56014 from Kouichi Hashikawa
Don't try to optimise away placing the "s" or " " after "N user"
(" " where N==1, "s" otherwise) when it seems unnecessary, as that
fails when the number of users hasn't changed, but the screen is
being redrawn from nothing (as in after being resumed from a ^Z,
as in the PR, but just doing a ^L would make the same thing happen).

XXX pullup -10 (maybe -9 as well - seems too trivial for -8).
2023-03-28 00:00:30 +00:00
kre e80b8c2299 Undo previous "restore lost break" and fix the issue that seems to
have been intending to correct properly (or at least, more rationally).

This makes adding/deleting drives for "vmstat" (and "iostat", though
the man page doesn't say that it also works there) using the :display
:ignore and :drive sub-commands work sensibly using fnmatch()
rather than what was there most of the time since it was added.

Previously ":ignore dk*" would ignore the first dk (wedge) found in
the system (whether or not it was ignored already) and that was it.
[":ignore dk* dk*" would just do that twice.]

Now the same command will ignore all dk* drives (all wedges), which
is what I would anticipate almost anyone would expect it to do.

Similarly for ":display" (to add drives) and ":drives" to explictly
list particular ones.

When the fnmatch() code was added, almost 9 and a half years ago now,
it was almost correct - except always resulted in an error occurring
(though that was little more than a minor inconvenience).

That was "fixed" 5 months later (9 years and almost a month ago now)
with the cvs log message "restore lost break" - which was absolutely
the wrong thing to do (the break was fine when no patterns were used,
and so a name could only ever match one drive - but wrong when the
whole point is to match many).

Somehow in the past 9+ years, no-one noticed that this functionality
had been rendered almost useless.

While here, fix a related problem ... just above I referred to the
error that occurred as a "minor inconvenience" - that's because while
an error would be shown on the screen, it would then immediately be
removed again, an observant user might notice the quick flash, but
that would be it.

Handle that by detecting whether any changes are actually made, and
don't go completely redrawing the screen (removing the error message
that was just placed there) if there is no point.   This doesn't
entirely fix this problem, as if we do

	:drives foo wd*

and there is no "foo" drive in the system, we'd get an error message
from that, but adding the wd* drives (assuming there are some, of course)
counts as a change, so that error message will still not last very long.
The order of that command line makes no difference, it isn't that wd drives
were found after foo wasn't, but that the whole line matched (at least one)
drive (and changed its state - for the "drives" command, that is equivalent
to matched) - but also contained an entry which did not match at all.
That's a harder problem to fix.

No pullups planned, as no-one seems to mind how it has been all this time.
2023-03-27 23:20:13 +00:00
ozaki-r be0f86d642 Adjust userland commands for struct inpcb separation
Only kvm users are affected.
2022-10-28 05:27:16 +00:00
ozaki-r 1fc70a0860 Adjust userland commands for struct inpcb integration
Only kvm users are affected.
2022-10-28 05:24:07 +00:00
nia 55a7892a0c systat(1): convert realloc(x * y) to reallocarr, eliminate a temp var 2021-11-09 09:19:01 +00:00
nia 1b3cdadf3b systat(1): convert free(x); x = malloc(x * y) to reallocarr.
free on NULL is a guaranteed non-op.
2021-11-09 09:18:02 +00:00
nia 6a8c5f4cd9 netstat(1): use reallocarr instead of realloc(x * y) 2021-10-30 11:31:51 +00:00
christos eb30bc23a0 PR/56331: Paul Goyette: Add -z option to display 0 instead of ' ' in vmstat. 2021-08-21 13:22:19 +00:00
simonb 12d3157b50 Instead of getting an estimate of the number of kernel buffers,
allocating memory for them, requesting all the metadata contents of
these buffers (and repeating in the unlikely case of the number of
buffers increasing too much since the estimate) and then straight away
throwing all the contents out just to count how many buffers there were,
just get the initial estimate from the kernel and subtract the slop.

Reduces system CPU usage of "systat vm" by approx 80% for any system
with a reasonable number of buffers.
2021-07-24 13:42:05 +00:00
maya 5858bd6b8c Remove SCCS workarounds. No binary change. 2021-04-17 08:34:27 +00:00
simonb 28c9f023c7 Add ${LIBUTIL} to DPADD. 2020-12-11 07:24:38 +00:00
simonb f34bcfad7a Use the vm.uspace sysctl instead of using the USPACE kernel define. 2020-08-26 10:56:01 +00:00
mrg befa44380d increase slot slop space from 100 to 1000 before giving up.
from Paul Ripke on current-users.  thanks!
2020-03-02 09:50:12 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
mrg 21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
he feecb28e70 Make the scaling of the "bytes written" sticky, so that if we go
to K, we don't return to unscaled, and similar for higher scales
(though it takes some effort, due to the wide field...)
Fixes PR#54334.
2019-06-30 19:57:23 +00:00
mrg a0193bc54d - use -Wno-error=format-truncation 2019-02-04 03:58:41 +00:00
mrg 37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
christos ace5fc6aeb no need for curses.h 2019-01-25 15:34:22 +00:00
christos 6b2ce0800e PR/53906: Paul Ripke: systat(1) vmstat & syscall get
"alternate system clock has died" on terminal resize (SIGWINCH)
2019-01-25 15:31:11 +00:00
tih b953ff3f9a Remove a format character from a non-format string. 2019-01-08 08:22:20 +00:00
wiz 48f9820ef3 Fix some macro usage. Fix a typo. 2018-12-28 12:21:53 +00:00
sevan 3986ee252c Remove commentd out options for fields no longer present in source. 2018-12-26 01:54:09 +00:00
sevan 5a5cdfa229 Extend "systat vm" output to provide better insight about buffercache and
document it.

From Greg A. Woods in PR bin/36542
2018-12-26 01:47:37 +00:00
maxv 5d73803e75 Remove now unused tcpip.h includes. Some were already unused before. 2018-05-03 07:13:48 +00:00
snj 4678f4dd6f add -b to usage. 2017-11-22 02:52:42 +00:00
mrg 079cbf3933 add missing 'b' to the optstring. alpha-sort the option handling. 2017-11-17 20:43:08 +00:00
mlelstv 9368f38e90 Use I/O timestamps to compute disk statistics for better precisison. 2017-07-15 08:22:23 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
chs ffdbc0ccea rearrange sys/mount.h so that all of the kernel-only parts are together
and not exposed to userland, except do expose struct mount if __EXPOSE_MOUNT
is defined.  define __EXPOSE_MOUNT in the kmem grovellers that want
the definition.  needed for ZFS.
2017-06-09 00:13:29 +00:00
christos 32377daaf2 need <sys/stat.h> 2017-01-10 21:14:51 +00:00
mrg 0537635d0c for 64 bit mips platforms where we built userland largely as n32 by
default, build a handful of tools as n64 so they work properly.

unfortunately, they're also static as dynamic n64 has a problem.

of these tools pstat is probably the lowest hanging fruit to convert
to sysctl.  systat would be close were it not for the netstat screen,
which includes netstat itself.

the rest are difficult to perhaps foolish.


the upside is that netstat, pmap and fstat all work properly now.
2016-12-23 10:19:57 +00:00
mrg 15bdea6a19 add a basic "-b" option - that outputs one display and exits.
inspired by "top -b".  still requires a curses-capable output
without some fairly significant internal restructuring.
2016-12-03 03:26:27 +00:00
christos 4667eeb169 sysctlbyname is convenient, but ain't cheap. Cache it. 2016-10-24 00:40:17 +00:00
christos 8ff995f221 allow fractional intervals 2016-10-22 22:02:55 +00:00
christos b31382fbd7 Avoid string gymnastics in an olympic year. 2016-08-05 07:22:17 +00:00
jakllsch ccf7078d06 Make this build with clang:
- Remove unused static const variables
 - Adjust impossibleish comparision.
2016-08-04 12:56:31 +00:00
wiz 4ff383b44d Bump date for new ifstat command. 2016-08-03 13:09:43 +00:00
scole 6f3aa0fcd4 Add $NetBSD$ tag for new files 2016-08-02 17:53:46 +00:00
scole bd7662dc4d PR bin/51204
Add ifstat command to systat.

Imported from FreeBSD
2016-08-02 15:56:09 +00:00
dholland a4db6377a4 NetBSD does actually support flat-panel displays. Even for systat(1).
(noted by tnn)
2016-03-12 02:39:01 +00:00
christos ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
mrg ef363e2dc9 if you change display types, the "Showing %s, refresh every %d seconds."
message is retained, and you can't get rid of it.  since it's dispalyed
in inverse, it feels like there's always an error happening (which is
really what the code has -- the above string is displayed via the error()
function.)  for several types of key press that largely are just "redraw"
operation (space, ^L, etc.), clear the error string as well.
2015-08-23 18:33:15 +00:00
dennis 7ad3371ebc Update stats-keeping in sys/kern/vfs_cache.c to remove (most)
races while allowing consistent lockless sampling of the per-cpu
statistics without atomic operations.  Update comment describing
the locking protocol to include this.

These files were fumble-fingered out of the last commit.
2014-12-24 20:01:21 +00:00
njoly e75f143af6 Remove fagile test which ensured that first namelist element (was
X_NCHSTATS) had a known type. Make disk stats available again for
vmstat display.
2014-06-20 07:08:15 +00:00
joerg 10aed88aaf GC X_NCHSTATS 2014-06-14 20:10:42 +00:00
joerg deae2c9ba3 Always use_sysctl in preparation of removing all kvm code. 2014-06-03 22:22:41 +00:00