kernel - Add a sampling history mechanism called kcollect
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 29 Jul 2017 06:36:07 +0000 (23:36 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 29 Jul 2017 06:47:50 +0000 (23:47 -0700)
commitf6aeec64f90d6f78631ca1b951202ca79c08ab2f
treeaf79ca8961e0d95d1e577d54b79a50b35da9e037
parent6b85667d4e2238370c79eed8c9dd862b09266b71
kernel - Add a sampling history mechanism called kcollect

* Add a kernel API which automatically samples useful statistics on a
  10-second period without needing a user program to poll it.  This API
  is enabled by default and can be disabled by setting kern.collect_samples=0
  in /boot/loader.conf (or setting it higher, if desired).

  The idea is for the kernel to always collect a solid amount of historical
  data for various useful statistics such that a user can pull it all up
  going back upwards of 23 hours (or more, depending on configured samples)
  after the fact.  "Oh, what happened recently"... bang.

* The sysctl provides sufficient information to userland to be able to
  process the statistics dynamically, without necessarily having to know
  what they are.

  The sysctl can be cut short to request less data for ongoing incremental
  collection, if desired.

* Implement "load" collection to start with as a test.  Add #defines for
  everything I want the kernel to collect.  The kernel API's critical path
  is lockless.

* Start working on a front-end user program called 'kcollect'.  This program
  will eventually generate fancy graphs via gnuplot and have a dbm interface
  for collecting data continuously if desired.
sys/conf/files
sys/kern/kern_collect.c [new file with mode: 0644]
sys/kern/kern_synch.c
sys/sys/kcollect.h [new file with mode: 0644]
usr.bin/kcollect/Makefile [new file with mode: 0644]
usr.bin/kcollect/kcollect.c [new file with mode: 0644]