Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/modules/filemon Remove filemon(4).



details:   https://anonhg.NetBSD.org/src/rev/488e85a7cfe8
branches:  trunk
changeset: 1006584:488e85a7cfe8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jan 19 20:41:17 2020 +0000

description:
Remove filemon(4).

Discussed on tech-kern:
https://mail-index.NetBSD.org/tech-kern/2020/01/13/msg025938.html

This was never (intentionally) enabled by default, and the design has
some shortcomings.  You can get mostly the same results with ktrace,
as in usr.bin/make/filemon/filemon_ktrace.c which is now used instead
of filemon for make's meta mode.

If applications require higher performance than ktrace, or nesting
that ktrace doesn't support, we might consider adding something back
into the vfs system calls themselves, without hijacking the syscall
table.  (Might want a more reliable output format too, e.g. one that
can handle newlines in file names.)

diffstat:

 distrib/sets/lists/base/mi         |    4 +-
 distrib/sets/lists/comp/mi         |    4 +-
 distrib/sets/lists/man/mi          |    8 +-
 etc/MAKEDEV.tmpl                   |    7 +-
 etc/mtree/NetBSD.dist.base         |    3 +-
 share/man/man4/Makefile            |    4 +-
 share/man/man4/filemon.4           |  248 --------------------
 sys/arch/amd64/conf/ALL            |    6 +-
 sys/arch/i386/conf/ALL             |    6 +-
 sys/conf/files                     |    8 +-
 sys/conf/majors                    |    4 +-
 sys/dev/Makefile                   |    4 +-
 sys/dev/filemon/Makefile           |    8 -
 sys/dev/filemon/filemon.c          |  445 ------------------------------------
 sys/dev/filemon/filemon.h          |   62 -----
 sys/dev/filemon/filemon_wrapper.c  |  456 -------------------------------------
 sys/dev/filemon/mknod-sh           |   22 -
 sys/modules/Makefile               |    3 +-
 sys/modules/filemon/Makefile       |   20 -
 sys/modules/filemon/filemon.ioconf |    7 -
 20 files changed, 22 insertions(+), 1307 deletions(-)

diffs (truncated from 1559 to 300 lines):

diff -r c58fd6944f91 -r 488e85a7cfe8 distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi        Sun Jan 19 20:22:57 2020 +0000
+++ b/distrib/sets/lists/base/mi        Sun Jan 19 20:41:17 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1225 2020/01/19 06:55:22 thorpej Exp $
+# $NetBSD: mi,v 1.1226 2020/01/19 20:41:17 riastradh Exp $
 #
 # Note:        Don't delete entries from here - mark them as "obsolete" instead,
 #      unless otherwise stated below.
@@ -1114,7 +1114,7 @@
 ./usr/include/dev/dmover                       base-c-usr
 ./usr/include/dev/dtv                          base-c-usr
 ./usr/include/dev/eisa                         base-obsolete           obsolete
-./usr/include/dev/filemon                      base-c-usr
+./usr/include/dev/filemon                      base-obsolete           obsolete
 ./usr/include/dev/hdaudio                      base-c-usr
 ./usr/include/dev/hdmicec                      base-c-usr
 ./usr/include/dev/hid                          base-c-usr
diff -r c58fd6944f91 -r 488e85a7cfe8 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Sun Jan 19 20:22:57 2020 +0000
+++ b/distrib/sets/lists/comp/mi        Sun Jan 19 20:41:17 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.2303 2020/01/19 20:00:36 thorpej Exp $
+#      $NetBSD: mi,v 1.2304 2020/01/19 20:41:17 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.comp                           comp-sys-root
@@ -411,7 +411,7 @@
 ./usr/include/dev/eisa/eisadevs_data.h         comp-obsolete           obsolete
 ./usr/include/dev/eisa/eisareg.h               comp-obsolete           obsolete
 ./usr/include/dev/eisa/eisavar.h               comp-obsolete           obsolete
-./usr/include/dev/filemon/filemon.h            comp-c-include
+./usr/include/dev/filemon/filemon.h            comp-obsolete           obsolete
 ./usr/include/dev/fssvar.h                     comp-c-include
 ./usr/include/dev/hdaudio/hdaudioio.h          comp-c-include
 ./usr/include/dev/hdaudio/hdaudioreg.h         comp-c-include
diff -r c58fd6944f91 -r 488e85a7cfe8 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Sun Jan 19 20:22:57 2020 +0000
+++ b/distrib/sets/lists/man/mi Sun Jan 19 20:41:17 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1673 2020/01/19 20:00:36 thorpej Exp $
+# $NetBSD: mi,v 1.1674 2020/01/19 20:41:17 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1105,7 +1105,7 @@
 ./usr/share/man/cat4/fast_ipsec.0              man-obsolete            obsolete
 ./usr/share/man/cat4/fd.0                      man-sys-catman          .cat
 ./usr/share/man/cat4/fea.0                     man-sys-catman          .cat
-./usr/share/man/cat4/filemon.0                 man-sys-catman          .cat
+./usr/share/man/cat4/filemon.0                 man-obsolete            obsolete
 ./usr/share/man/cat4/finsio.0                  man-sys-catman          .cat
 ./usr/share/man/cat4/flash.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/fms.0                     man-sys-catman          .cat
@@ -4289,7 +4289,7 @@
 ./usr/share/man/html4/fast_ipsec.html          man-obsolete            obsolete
 ./usr/share/man/html4/fd.html                  man-sys-htmlman         html
 ./usr/share/man/html4/fea.html                 man-sys-htmlman         html
-./usr/share/man/html4/filemon.html             man-sys-htmlman         html
+./usr/share/man/html4/filemon.html             man-obsolete            obsolete
 ./usr/share/man/html4/finsio.html              man-sys-htmlman         html
 ./usr/share/man/html4/flash.html               man-sys-htmlman         html
 ./usr/share/man/html4/fms.html                 man-sys-htmlman         html
@@ -7245,7 +7245,7 @@
 ./usr/share/man/man4/fast_ipsec.4              man-obsolete            obsolete
 ./usr/share/man/man4/fd.4                      man-sys-man             .man
 ./usr/share/man/man4/fea.4                     man-sys-man             .man
-./usr/share/man/man4/filemon.4                 man-sys-man             .man
+./usr/share/man/man4/filemon.4                 man-obsolete            obsolete
 ./usr/share/man/man4/finsio.4                  man-sys-man             .man
 ./usr/share/man/man4/flash.4                   man-sys-man             .man
 ./usr/share/man/man4/fms.4                     man-sys-man             .man
diff -r c58fd6944f91 -r 488e85a7cfe8 etc/MAKEDEV.tmpl
--- a/etc/MAKEDEV.tmpl  Sun Jan 19 20:22:57 2020 +0000
+++ b/etc/MAKEDEV.tmpl  Sun Jan 19 20:41:17 2020 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#      $NetBSD: MAKEDEV.tmpl,v 1.212 2019/12/23 06:45:37 maxv Exp $
+#      $NetBSD: MAKEDEV.tmpl,v 1.213 2020/01/19 20:41:18 riastradh Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -816,7 +816,6 @@
        makedev dk24 dk25 dk26 dk27 dk28 dk29 dk30 dk31
        makedev ccd0 ccd1 ccd2 ccd3
        makedev cgd0 cgd1 cgd2 cgd3
-       makedev filemon
        makedev fss0 fss1 fss2 fss3
        makedev md0 md1
        makedev raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7
@@ -2182,10 +2181,6 @@
        mkdev dtrace/dtrace c %dtrace_chr% 0 600
        ;;
 
-filemon)
-       mkdev filemon c %filemon_chr% 0 666
-       ;;
-
 fw[0-9]*)
        unit=${i#fw}
        for j in 0 1 2 3
diff -r c58fd6944f91 -r 488e85a7cfe8 etc/mtree/NetBSD.dist.base
--- a/etc/mtree/NetBSD.dist.base        Sun Jan 19 20:22:57 2020 +0000
+++ b/etc/mtree/NetBSD.dist.base        Sun Jan 19 20:41:17 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.base,v 1.208 2019/12/23 06:45:37 maxv Exp $
+#      $NetBSD: NetBSD.dist.base,v 1.209 2020/01/19 20:41:18 riastradh Exp $
 #      @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -121,7 +121,6 @@
 ./usr/include/dev/dm
 ./usr/include/dev/dmover
 ./usr/include/dev/dtv
-./usr/include/dev/filemon
 ./usr/include/dev/hdaudio
 ./usr/include/dev/hdmicec
 ./usr/include/dev/hid
diff -r c58fd6944f91 -r 488e85a7cfe8 share/man/man4/Makefile
--- a/share/man/man4/Makefile   Sun Jan 19 20:22:57 2020 +0000
+++ b/share/man/man4/Makefile   Sun Jan 19 20:41:17 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.697 2020/01/19 20:00:35 thorpej Exp $
+#      $NetBSD: Makefile,v 1.698 2020/01/19 20:41:18 riastradh Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -23,7 +23,7 @@
        dmphy.4 dpt.4 dpti.4 drm.4 drum.4 drvctl.4 dtv.4 dtviic.4 dwctwo.4 \
        eap.4 ebus.4 edc.4 elmc.4 emuxki.4 ena.4 envsys.4 ep.4 esh.4 \
        esa.4 esiop.4 esm.4 eso.4 et.4 etphy.4 exphy.4 \
-       fd.4 filemon.4 finsio.4 flash.4 fpa.4 fms.4 fss.4 \
+       fd.4 finsio.4 flash.4 fpa.4 fms.4 fss.4 \
        fujbp.4 full.4 fxp.4 \
        gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \
        glxtphy.4 gpib.4 gpio.4 gpioirq.4 gpiolock.4 gpiopps.4 gpiopwm.4 \
diff -r c58fd6944f91 -r 488e85a7cfe8 share/man/man4/filemon.4
--- a/share/man/man4/filemon.4  Sun Jan 19 20:22:57 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,248 +0,0 @@
-.\"    $NetBSD: filemon.4,v 1.21 2019/12/23 06:45:37 maxv Exp $
-.\"
-.\" Copyright (c) 2011, Juniper Networks, Inc.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\"    notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\"    notice, this list of conditions and the following disclaimer in the
-.\"    documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd January 6, 2016
-.Dt FILEMON 4
-.Os
-.Sh NAME
-.Nm filemon
-.Nd track interesting system calls
-.Sh SYNOPSIS
-.Cd "pseudo-device filemon"
-.Sh DESCRIPTION
-In normal situations,
-.Nm
-is not built-in to the kernel, and a call to open
-.Pa /dev/filemon
-will auto-load the
-.Nm
-module (see
-.Xr module 7
-for more details).
-.Pp
-(Although not recommended, the
-.Nm
-facility can be included in a kernel build by adding
-.Bd -literal -offset indent
-pseudo-device filemon
-.Ed
-.Pp
-to the kernel configuration file.)
-.Pp
-.Nm
-provides a means for tracking the successful system calls performed by
-a process and its descendants.
-It is used by
-.Xr make 1
-to track the activities of build scripts, for the purpose of automatically
-learning dependencies.
-.Pp
-The data captured by
-.Nm
-for the script
-.Bd -literal -offset indent
-n=`wc -l /etc/motd`; echo "int motd_lines = $n;" > foo.h.new
-cmp -s foo.h foo.h.new 2> /dev/null || mv foo.h.new foo.h
-.Ed
-.Pp
-looks like:
-.Bd -literal -offset indent
-# filemon version 4
-# Target pid 24291
-V 4
-E 29676 /bin/sh
-R 29676 /etc/ld.so.conf
-R 29676 /lib/libedit.so.2
-R 29676 /lib/libterminfo.so.1
-R 29676 /lib/libc.so.12
-F 29676 4899
-E 4899 /usr/bin/wc
-R 4899 /etc/ld.so.conf
-R 4899 /usr/lib/libc.so.12
-R 4899 /etc/motd
-X 4899 0
-W 29676 foo.h.new
-X 29676 0
-# Bye bye
-E 3250 /bin/sh
-R 3250 /etc/ld.so.conf
-R 3250 /lib/libedit.so.2
-R 3250 /lib/libterminfo.so.1
-R 3250 /lib/libc.so.12
-W 26673 /dev/null
-E 26673 /usr/bin/cmp
-R 26673 /etc/ld.so.conf
-R 26673 /usr/lib/libc.so.12
-X 26673 2
-E 576 /bin/mv
-R 576 /etc/ld.so.conf
-R 576 /lib/libc.so.12
-M 576 'foo.h.new' 'foo.h'
-X 576 0
-X 3250 0
-# Bye bye
-.Ed
-.Pp
-Most records follow the format:
-.Bd -literal -offset indent
-type pid data
-.Ed
-.Pp
-where
-.Ar type
-is one of the list below, and unless otherwise specified,
-.Ar data
-is a pathname.
-.Bl -tag -width Ds -offset indent
-.It Dv C
-.Xr chdir 2 .
-.It Dv D
-.Xr unlink 2 .
-.It Dv E
-.Xr exec 3 .
-.It Dv F
-.Xr fork 2 ,
-.Xr vfork 2 ;
-.Ar data
-is the process id of the child.
-.It Dv L
-.Xr link 2 ,
-.Xr symlink 2 ;
-.Ar data
-is two pathnames.
-.It Dv M
-.Xr rename 2 ;
-.Ar data
-is two pathnames.
-.It Dv R
-.Xr open 2
-for read or read-write.
-.It Dv W
-.Xr open 2
-for writing or read-write.
-.It Dv X
-.Xr exit 3 ;
-.Ar data
-is the exit status.
-.It Dv V
-indicates the version of
-.Nm .
-.El
-.Pp
-A
-.Nm
-instance is created by opening
-.Pa /dev/filemon .
-Then use
-.Fn ioctl filemon_fd FILEMON_SET_PID &pid
-to identify the target process to monitor, and



Home | Main Index | Thread Index | Old Index