freebsd-skq/share
Bryan Drewery e0d84b9ee9 Track filemon usage via a proc.p_filemon pointer rather than its own lists.
- proc.p_filemon is added which is protected by PROC_LOCK.  This improves
  performance and avoids double-fork issues, taking allproc_lock
  while in syscalls, and walking the process tree in syscalls.  A
  particular proc.p_filemon can only be changed to NULL or another
  filemon, or the filemon inherited, while the filemon->lock is held.
- Filemon are reference counted.  On the last reference the log will be closed.
- When closing the devfs file handle, the filemon will be detached from all
  processes and inheritance prevented.
- Disallow attaching to a process already being traced since filemon is
  typically intended to be used on children only.  This is allowed for
  curproc as bmake relies on this behavior for rare cases when combining
  .MAKE with .META.
- Detach any previously tracked process on ioctl(FILEMON_SET_PID).
- Handle error from devfs_set_cdevpriv() in filemon_open().
- The global filemon lock and lists are removed.
- A free list is no longer kept.  Previously this list was
  forever-expanding and never garbage cleaned.
- No longer loses track of double-forks.  If the process holding the filemon
  handle closes it will close the log rather than wait on a daemonized process,
  but it will log all activity until it closes its handle.  The filemon
  will be removed from the process and not inherited.
- A separate process count is kept only as an optimization for
  forced detachment to avoid taking allproc_lock and walking the entire
  process tree.
- struct filemon access is protected by sx(9) filemon->lock as it was before.
- Add more comments and KASSERTS.

MFC after:	2 weeks
Reviewed by:	kib, mjg, markj (all on previous versions)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5520
2016-03-21 20:29:27 +00:00
..
colldef Simplify the locale generated Makefiles by using bmake multi variables for loops 2015-12-18 21:34:28 +00:00
ctypedef Use :E instead of regex in ctypedef Makefiles 2015-12-19 12:26:01 +00:00
dict Add META_MODE support. 2015-06-13 19:20:56 +00:00
doc Rename the /usr/share/doc/legal files to driver.LICENSE to work around 2015-10-16 00:38:05 +00:00
dtrace fix tcpdebug: - assign to "flags" in each probe, not only debug-input 2016-03-03 02:46:12 +00:00
examples META_MODE: Simplify the META_COOKIE handling to use .USE/.USEBEFORE. 2016-03-11 23:45:28 +00:00
i18n Remove exists() checks so normal out-of-date handling can be used. 2016-03-11 23:45:36 +00:00
keys META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
locale-links META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
man Track filemon usage via a proc.p_filemon pointer rather than its own lists. 2016-03-21 20:29:27 +00:00
me Add META_MODE support. 2015-06-13 19:20:56 +00:00
misc Add myself as a ports committer 2016-03-05 11:20:02 +00:00
mk Update to bmake-20160315 2016-03-18 20:03:09 +00:00
monetdef Simplify the locale generated Makefiles by using bmake multi variables for loops 2015-12-18 21:34:28 +00:00
msgdef Simplify the locale generated Makefiles by using bmake multi variables for loops 2015-12-18 21:34:28 +00:00
numericdef Simplify the locale generated Makefiles by using bmake multi variables for loops 2015-12-18 21:34:28 +00:00
security META MODE: These need object directories to handle staging. 2015-11-26 01:14:27 +00:00
sendmail META_MODE: Simplify the META_COOKIE handling to use .USE/.USEBEFORE. 2016-03-11 23:45:28 +00:00
skel Use more appropriate ${SHAREDIR} rather than /usr/share. 2015-10-27 23:35:02 +00:00
snmp Add META_MODE support. 2015-06-13 19:20:56 +00:00
syscons Add more SUBDIR_PARALLEL. 2015-10-15 22:55:08 +00:00
tabset Add META_MODE support. 2015-06-13 19:20:56 +00:00
termcap Replace ln -s calls with INSTALL_SYMLINK 2015-12-04 03:17:14 +00:00
tests DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
timedef Restore a day of the week in date(1) output for Japanese locales. 2015-12-20 14:59:30 +00:00
vt Remove uudecode make rule for vt fonts 2016-02-29 18:35:16 +00:00
zoneinfo META_MODE: Simplify the META_COOKIE handling to use .USE/.USEBEFORE. 2016-03-11 23:45:28 +00:00
Makefile Merge from head 2015-10-19 11:51:10 +00:00
Makefile.inc