Commit Graph

299 Commits

Author SHA1 Message Date
dholland
32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
mrg
2c65d957b0 deref the right address to get the pool_allocator. 2017-12-04 03:05:57 +00:00
mrg
cd83415f42 remove now wrong comment. minor KNF. 2017-12-03 21:10:01 +00:00
mrg
67dafd4718 fix the kvm version of counting pool pages for vmstat -s. 2017-12-03 21:09:01 +00:00
mrg
277fd3d5f5 add two new members to uvmexp_sysctl{}: bootpages and poolpages.
bootpages is set to the pages allocated via uvm_pageboot_alloc().
poolpages is calculated from the list of pools nr_pages members.

this brings us closer to having a valid total of pages known by
the system, vs actual pages originally managed.

XXX: poolpages needs some handling for PR_RECURSIVE pools still.
2017-12-02 08:15:42 +00:00
pgoyette
64ae8753d8 Remove the ABI version-and-length check that was recently introduced;
sysctl(9) ABIs should be stable across versions.

XXX Pull-up to -8
2017-11-03 22:45:14 +00:00
pgoyette
cb32a134a5 Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
  the kernel and in the structures used for exporting the history data
  to userland via sysctl(9).  This avoids problems on some architectures
  where passing a 64-bit (or larger) value to printf(3) can cause it to
  process the value as multiple arguments.  (This can be particularly
  problematic when printf()'s format string is not a literal, since in
  that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
  include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
  updated.  Each format specifier now includes an explicit length
  modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
  updated to replace uses of "%p" with "%#jx", and the pointer
  arguments are now cast to (uintptr_t) before being subsequently cast
  to (uintmax_t).  This is needed to avoid compiler warnings about
  casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
  "%c" format strings replaced with numeric formats; several instances
  of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
  history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
  the -u option does not exist (previously, this condition was silently
  ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
  data exported via sysctl(9) and exits if they do not match the values
  with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
  requirements imposed on the format strings, along with several other
  minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
    uint64_t) for the history arguments.  But that would require another
    "rototill" of all the users in the future when we add support for an
    architecture that supports a larger size.  Also, the printf(3) format
    specifiers for explicitly-sized values, such as "%"PRIu64, are much
    more verbose (and less aesthetically appealing, IMHO) than simply
    using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
    but it is possible that I've missed some of them.  I would be glad to
    update any stragglers that anyone identifies.
2017-10-28 00:37:11 +00:00
mlelstv
809af110e7 Don't print "nan" when there is no disk activity. 2017-09-06 06:05:23 +00:00
mlelstv
245a1a4599 Use I/O timestamps to compute disk statistics for better precision.
Disk statistics are collected in a fixed size array, that got corrupted
when a disk was detached. Adapt by skipping entries of detached disks
and detect reused disknames at the array end.
2017-07-04 21:19:33 +00:00
mlelstv
ba576b71a7 Enhance disk metrics by calculating a weighted sum that is incremented
by the number of concurrent I/O requests. Also introduce a new disk_wait()
function to measure requests waiting in a bufq.
iostat -y now reports data about waiting and active requests.

So far only drivers using dksubr and dk, ccd, wd and xbd collect data about
waiting requests.
2017-03-05 23:07:12 +00:00
ryo
55563c97ca "vmstat -ie[v]" auto fit to minimum columns
Reviewed by msaitoh@
2017-01-05 07:53:20 +00:00
pgoyette
c0a30d4dc7 Adapt to use of bintime(9) for kernel history timestamps (7.99.55). 2017-01-05 03:42:27 +00:00
pgoyette
09c45791e2 Fix error handling confusion between error and errno 2017-01-04 01:29:18 +00:00
pgoyette
394eed3eed Adapt to new version of the sysctl export structure 2017-01-04 01:06:26 +00:00
pgoyette
58e3ff39b3 Use appropriate PRI* format specifiers for fixed-bit-size numbers
Should fix i386 build.
2017-01-02 09:24:54 +00:00
pgoyette
ba8c50ff8b For kvm-based kernhist code, print size of history table and "next free"
pointer, same as we do for sysctl-based code.
2017-01-02 02:08:05 +00:00
pgoyette
6a4fc5e568 Restore the kvm-grovelling code for use on crash files (where sysctl(3)
is not available).  Otherwise, this would always report on the current
running kernel regardless of the use of -M option.
2017-01-02 01:48:56 +00:00
pgoyette
93058c7f3d For kernel history display, replace the kvm grovelling with the newly
available sysctl access to the history data.

XXX vmstat still uses kvm for several other displays
2017-01-02 01:02:19 +00:00
mrg
1383c0c74f build vmstat as n64 on mips64. only kernel histories and hash stats
need to be fixed fot this to be reverted.
2016-12-29 23:42:38 +00:00
christos
bb762fe5ee No point in using float here; makes evbmips64 need __truncdfsf2, and that
causes static linking issues because of softfloat.
2016-10-04 17:36:21 +00:00
sevan
39bbc68a3b Drop main() prototype. 2016-09-05 00:40:28 +00:00
christos
e33113ab6d Work around gcc on sparc64 bug 2016-03-06 18:01:28 +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
skrll
f6dcbec3a9 Trailing whitespace. 2014-09-12 16:25:55 +00:00
skrll
e52f4ab9a5 Print the cpu in the kernhist record. 2014-09-12 16:25:29 +00:00
nakayama
653203959c Use u_long to avoid negative value outputs. 2014-07-12 20:04:31 +00:00
joerg
99d9473857 Init summary counters. 2014-06-14 04:06:54 +00:00
joerg
11e7f587a5 Fix format string for ILP32. 2014-06-14 01:26:59 +00:00
joerg
67c88a0d78 Use kern.pool for the live system. 2014-06-13 19:10:01 +00:00
joerg
7be9a8f800 Remove unused headers. 2014-06-13 11:26:37 +00:00
joerg
6cf722d5a8 GC left-over kread. 2014-06-03 21:56:30 +00:00
joerg
472ed4a521 Use CPU statistics from uvmexp when possible. 2014-06-03 21:56:03 +00:00
joerg
201b45ebb5 Use kern.clockrate if possible. 2014-06-03 21:45:41 +00:00
joerg
100b00cbbc Convert the remaining uvmexp users to the sysctl as default source. 2014-06-03 21:41:56 +00:00
joerg
5b23be7ac8 Use vm.uvmexp data as much as possible for vmstat -s.
Temporarily disable shadowing warning until the other users are cleaned
up.
2014-06-03 21:31:54 +00:00
joerg
94adc2671a Provide sysctl for namecache statistics. 2014-06-03 21:16:15 +00:00
joerg
93b8079710 GC unused variables. 2014-06-02 22:57:50 +00:00
joerg
11c4049413 Drop kvm-based access for driver statistics. 2014-06-02 19:29:00 +00:00
joerg
8670ce0cf0 Make missing kern.evcnt an error, don't try to fallback to kmem use. 2014-06-02 19:16:10 +00:00
hannken
42c8d67c49 Add a global vnode cache:
- vcache_get() retrieves a referenced and initialised vnode / fs node pair.
- vcache_remove() removes a vnode / fs node pair from the cache.

On cache miss vcache_get() calls new vfs operation vfs_loadvnode() to
initialise a vnode / fs node pair.  This call is guaranteed exclusive,
no other thread will try to load this vnode / fs node pair.

Convert ufs/ext2fs, ufs/ffs and ufs/mfs to use this interface.

Remove now unused ufs/ufs_ihash

Discussed on tech-kern.

Welcome to 6.99.41
2014-05-08 08:21:53 +00:00
dsl
dc210c7fbd Remove some pointless inclusions os sys/user.h 2014-02-19 20:42:14 +00:00
rmind
df64447ca6 Remove cpu_queue (and thus eleminate another use of CIRCLEQ) by replacing
its uses with cpu_infos array.  Extra testing by christos@.
2013-11-24 21:58:38 +00:00
mrg
5517e5441c add a row with totals for some pool statistics. 2013-11-10 05:16:10 +00:00
chs
ad0d9d79c0 fix operation on core files: cur_drive.io_name is an embedded array
in the structure we already fetched, not a pointer, so don't try to
dereference its address as a kernel address.
2012-11-13 14:09:58 +00:00
para
308636e770 remove malloc(9) output function from vmstat
it is not required and working any more
2012-04-29 16:23:56 +00:00
matt
d34c2845b8 Use C89 function definitions 2012-03-20 20:34:57 +00:00
christos
81aad1d7e8 use warn instead of perror. 2011-10-15 21:59:48 +00:00
christos
76f57a76c2 unbreak -f -H -h, etc, part 1
- get nlist once in the beginning and fix the flags. Not each time! It is
not like the kernel will change it symbols in the middle of the run.
2011-10-15 21:06:05 +00:00
jym
37232010ea Use __arraycount(), as done above. 2011-09-21 12:08:02 +00:00
joerg
a12e209ee8 Mark usage as static and __dead. 2011-09-06 18:44:46 +00:00