summaryrefslogtreecommitdiffstats
path: root/share/man/man4/filemon.4
Commit message (Collapse)AuthorAgeFilesLines
* Handle copyin failures.bdrewery2016-03-221-0/+9
| | | | | | | | | | | | | | Skip the log entry as there is nothing good to write out. Don't fail the syscall though since it already succeeded. There's no reason filemon's tracing failure should fail the already-succeeded syscall. Record the error for later to return from close(2) on the filemon devfs file descriptor. Discussed with: markj, sjg, kib (briefly with kib) Reported by: mjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Return any log write failure encountered when closing the filemon fd.bdrewery2016-03-221-0/+6
| | | | | | | Discussed with: sjg, markj Reviewed by: sjg MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Spell out 'system calls'.bdrewery2016-03-221-2/+2
| | | | | MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Document openat(2) behavior.bdrewery2016-03-211-0/+7
| | | | | MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Stop tracking stat(2).bdrewery2016-03-211-2/+0
| | | | | | | | | | | | | | None of lstat(2), fstat(2), fstatat(2) were tracked either. The other filemon implementations also do not track stat(2), nor does bmake utilize it. The act of opening a file for read should be enough to decide that a file is a dependency. There could be rare cases where just having a file would cause a dependency but it is unlikely. MFC after: 2 weeks Also noted by: sjg Sponsored by: EMC / Isilon Storage Division
* Track filemon usage via a proc.p_filemon pointer rather than its own lists.bdrewery2016-03-211-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* FILEMON_SET_FD: Disallow changing the fd.bdrewery2016-03-091-1/+14
| | | | | | MFC after: 1 week Suggested by: mjg Sponsored by: EMC / Isilon Storage Division
* Require kldunload -f to unload.bdrewery2016-03-071-0/+3
| | | | | | | | | | Code may still be executing from the wrappers at unload time and thus is not generally safe to unload. Converting the wrappers to use EVENTHANDLER(9) will allow this to safely drain on active threads in hooks. More work on EVENTHANDLER(9) is needed first. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Note the double fork behavior with filemon.bdrewery2016-01-291-0/+5
| | | | | | X-MFC-With: r295029 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Document the purpose and non-purpose of filemon(4).bdrewery2016-01-291-1/+17
| | | | | MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Note that script(1) consumes filemon(4).obrien2014-09-031-0/+1
|
* Fix and improve filemon(4) example:pluknet2013-06-141-8/+4
| | | | | | | | | - remove return statements from void function [1] - include missing header - use O_CLOEXEC instead of separate fcntl() calls PR: docs/179459 [1] MFC after: 1 week
* Add to the description and spell check.obrien2012-06-061-4/+6
|
* mdoc police.obrien2012-06-051-22/+30
| | | | | Submitted by: ru Much thanks to: ru
* Various mdoc fixes.joel2012-06-051-8/+9
|
* Correct examples to the latest version I had.obrien2012-06-051-3/+4
|
* Add a man page for filemon(4) [r236592].obrien2012-06-041-0/+166
OpenPOWER on IntegriCloud