From owner-svn-src-stable@FreeBSD.ORG Fri Jun 7 21:39:49 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01A6873C; Fri, 7 Jun 2013 21:39:48 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E535D16E1; Fri, 7 Jun 2013 21:39:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r57LdmWx069109; Fri, 7 Jun 2013 21:39:48 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r57LdlEl069096; Fri, 7 Jun 2013 21:39:47 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201306072139.r57LdlEl069096@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 7 Jun 2013 21:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251511 - in stable/8: etc/mtree include sys/dev/filemon sys/modules/filemon tools/regression/filemon X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2013 21:39:49 -0000 Author: obrien Date: Fri Jun 7 21:39:46 2013 New Revision: 251511 URL: http://svnweb.freebsd.org/changeset/base/251511 Log: MF9: r237968, r251504: MFC: r251368, r251382: Match the options of the kernel. MFC: r237279: install filemon.h into /usr/include for userland consumption. Modified: stable/8/etc/mtree/BSD.include.dist stable/8/include/Makefile stable/8/sys/dev/filemon/filemon.c stable/8/sys/dev/filemon/filemon_wrapper.c stable/8/sys/modules/filemon/Makefile stable/8/tools/regression/filemon/Makefile stable/8/tools/regression/filemon/filemontest.c stable/8/tools/regression/filemon/test_script.sh Directory Properties: stable/8/ (props changed) stable/8/etc/ (props changed) stable/8/include/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/modules/ (props changed) stable/8/tools/ (props changed) Modified: stable/8/etc/mtree/BSD.include.dist ============================================================================== --- stable/8/etc/mtree/BSD.include.dist Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/etc/mtree/BSD.include.dist Fri Jun 7 21:39:46 2013 (r251511) @@ -96,6 +96,8 @@ .. ciss .. + filemon + .. firewire .. hwpmc Modified: stable/8/include/Makefile ============================================================================== --- stable/8/include/Makefile Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/include/Makefile Fri Jun 7 21:39:46 2013 (r251511) @@ -39,7 +39,8 @@ LDIRS= bsm cam geom net net80211 netatal sys vm LSUBDIRS= cam/ata cam/scsi \ - dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/firewire dev/hwpmc \ + dev/acpica dev/agp dev/an dev/bktr dev/ciss \ + dev/filemon dev/firewire dev/hwpmc \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ Modified: stable/8/sys/dev/filemon/filemon.c ============================================================================== --- stable/8/sys/dev/filemon/filemon.c Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/sys/dev/filemon/filemon.c Fri Jun 7 21:39:46 2013 (r251511) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include Modified: stable/8/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- stable/8/sys/dev/filemon/filemon_wrapper.c Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/sys/dev/filemon/filemon_wrapper.c Fri Jun 7 21:39:46 2013 (r251511) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #if __FreeBSD_version > 800032 #define FILEMON_HAS_LINKAT #endif Modified: stable/8/sys/modules/filemon/Makefile ============================================================================== --- stable/8/sys/modules/filemon/Makefile Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/sys/modules/filemon/Makefile Fri Jun 7 21:39:46 2013 (r251511) @@ -4,6 +4,6 @@ KMOD= filemon SRCS= ${KMOD}.c -SRCS+= vnode_if.h opt_compat.h opt_capsicum.h +SRCS+= opt_compat.h .include Modified: stable/8/tools/regression/filemon/Makefile ============================================================================== --- stable/8/tools/regression/filemon/Makefile Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/tools/regression/filemon/Makefile Fri Jun 7 21:39:46 2013 (r251511) @@ -1,10 +1,20 @@ # $FreeBSD$ -BINS= \ +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" +BI_BITS= +.endif + +_BINS= \ filemontest \ - timed-forkb + timed-forkb \ + sizeof_long + +BINS= ${_BINS} +.if defined(BI_BITS) +BINS+= ${_BINS:C/$/32/g} +.endif -bins: filemontest timed-forkb +bins: ${BINS} all: bins NO_MAN= @@ -18,16 +28,25 @@ WITHOUT_CDDL= CLEANFILES+= ${BINS} -tests: bins + +.for f32 in ${BINS} +${f32}32: ${f32}.c + ${CC} -m32 -DBIT=\"32\" -o ${.TARGET} ${CFLAGS} ${.ALLSRC} +.endfor + +tests: kldstat | grep filemon - ${MAKE} test - ./timed-forkb + @echo "" + ${MAKE} test01 + ${MAKE} test02 +.if defined(BI_BITS) + ${MAKE} test32 +.endif @echo "filemon(4) tests passed." # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in . -#FILEMONTEST32= filemontest32 -test: filemontest clean-test -.for BIN in filemontest ${FILEMONTEST32} +test01: ${BINS:Mfilemontest*} ${BINS:Msizeof_long*} clean-test +.for BIN in ${BINS:Mfilemontest} cd ${.CURDIR} ; \ for A in 1 2 3 4 5 6 7 8 9 0; do \ for B in 1 2 3 4 5 6 7 8 9 0; do \ @@ -37,10 +56,31 @@ test: filemontest clean-test done ;\ done @cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \ - grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo "Time stamp format OK" + grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || printf "Time stamp format OK\n\n" .endfor + @cd ${.CURDIR} ; set +e ; for F in filemon_log.* ; do \ + tail -1 $$F | grep -q '# Bye bye' || echo "$$F missing filemon bye-bye" ; \ + NL=`wc -l $$F | awk '{print $$1}'` ; \ + if [ "$${NL}" != 97 ]; then echo "$$F BAD, contains $${NL} lines" ; exit 1 ; fi ; done + +test02: ${BINS:Mtimed-forkb*} + @echo "Without filemon(4) active:" + ./timed-forkb + @echo "With filemon(4) active:" + script -f typescript-timed-forkb ./timed-forkb + ls -l typescript-timed-forkb.filemon + +test32: ${BINS:M*32*} + script -f typescript.${.TARGET} ./sizeof_long32 >/dev/null + @tail -1 typescript.test32.filemon | grep -q '# Bye bye' || (echo '32-bit comapt filemon Missing "bye-bye"' ; exit 1) + @egrep -q '^X [0-9]+ 0$$' typescript.test32.filemon || (echo "32-bit binary exit ERROR" ; exit 1) + @printf "filemon(4) 32bit FreeBSD support passed.\n\n" + +CLEANFILES+= typescript-timed-forkb typescript-timed-forkb.filemon clean-test: - cd ${.CURDIR} ; rm -f filemon_log.* + cd ${.CURDIR} ; rm -f filemon_log*.* + +clean-tests: clean-test .include Modified: stable/8/tools/regression/filemon/filemontest.c ============================================================================== --- stable/8/tools/regression/filemon/filemontest.c Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/tools/regression/filemon/filemontest.c Fri Jun 7 21:39:46 2013 (r251511) @@ -43,9 +43,13 @@ __FBSDID("$FreeBSD$"); * "test_script.sh" in the cwd. */ +#ifndef BIT +#define BIT "" +#endif + int main(void) { - char log_name[] = "filemon_log.XXXXXX"; + char log_name[] = "filemon_log" BIT ".XXXXXX"; pid_t child; int fm_fd, fm_log; @@ -66,7 +70,7 @@ main(void) { child = getpid(); if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1) err(1, "Cannot set filemon PID to %d", child); - system("./test_script.sh"); + system("env BIT=" BIT " ./test_script.sh"); break; case -1: err(1, "Cannot fork"); Modified: stable/8/tools/regression/filemon/test_script.sh ============================================================================== --- stable/8/tools/regression/filemon/test_script.sh Fri Jun 7 21:23:11 2013 (r251510) +++ stable/8/tools/regression/filemon/test_script.sh Fri Jun 7 21:39:46 2013 (r251511) @@ -41,3 +41,4 @@ ed -s $f1 < $f2 #w" | ed -s $f1 #rm $f1 $f2 uptime > /dev/null +sizeof_long${BIT} > /dev/null