svn commit: r211945 - in user/imp/tbemd: . bin/pax bin/test cddl/contrib/opensolaris/cmd/zdb cddl/usr.sbin cddl/usr.sbin/dtruss contrib/gcc contrib/top etc/defaults etc/periodic/daily gnu/lib/libgo...

Warner Losh imp at FreeBSD.org
Sat Aug 28 18:49:52 UTC 2010


Author: imp
Date: Sat Aug 28 18:49:51 2010
New Revision: 211945
URL: http://svn.freebsd.org/changeset/base/211945

Log:
  Merge from head at 211943

Added:
  user/imp/tbemd/cddl/usr.sbin/dtruss/dtruss.1
     - copied unchanged from r211943, head/cddl/usr.sbin/dtruss/dtruss.1
  user/imp/tbemd/sys/mips/rmi/fmn.c
     - copied unchanged from r211943, head/sys/mips/rmi/fmn.c
  user/imp/tbemd/sys/mips/rmi/xlr_pcmcia.c
     - copied unchanged from r211943, head/sys/mips/rmi/xlr_pcmcia.c
  user/imp/tbemd/sys/x86/pci/
     - copied from r211943, head/sys/x86/pci/
Deleted:
  user/imp/tbemd/lib/libthread_db/arch/powerpc64/
  user/imp/tbemd/secure/lib/libcrypto/opensslconf-powerpc64.h
  user/imp/tbemd/sys/mips/rmi/on_chip.c
Modified:
  user/imp/tbemd/Makefile.inc1
  user/imp/tbemd/Makefile.mips
  user/imp/tbemd/bin/pax/tar.c
  user/imp/tbemd/bin/test/test.1
  user/imp/tbemd/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  user/imp/tbemd/cddl/usr.sbin/Makefile
  user/imp/tbemd/cddl/usr.sbin/dtruss/Makefile
  user/imp/tbemd/contrib/gcc/crtstuff.c
  user/imp/tbemd/etc/defaults/rc.conf
  user/imp/tbemd/etc/periodic/daily/800.scrub-zfs
  user/imp/tbemd/gnu/lib/libgomp/Makefile
  user/imp/tbemd/lib/Makefile
  user/imp/tbemd/lib/libc/Makefile
  user/imp/tbemd/lib/libc/net/ethers.3
  user/imp/tbemd/lib/libc/net/eui64.3
  user/imp/tbemd/lib/libc/net/sctp_send.3
  user/imp/tbemd/lib/libc/net/sctp_sendmsg.3
  user/imp/tbemd/lib/libc/stdio/printf.3
  user/imp/tbemd/lib/libc/stdlib/atexit.c
  user/imp/tbemd/lib/libc/stdlib/malloc.3
  user/imp/tbemd/lib/libc/sys/mmap.2
  user/imp/tbemd/lib/libc/sys/semop.2
  user/imp/tbemd/lib/libipx/ipx.3
  user/imp/tbemd/lib/libkvm/Makefile
  user/imp/tbemd/lib/libthr/thread/thr_exit.c
  user/imp/tbemd/lib/libthr/thread/thr_fork.c
  user/imp/tbemd/lib/libthr/thread/thr_private.h
  user/imp/tbemd/lib/libthr/thread/thr_rtld.c
  user/imp/tbemd/lib/libthr/thread/thr_spec.c
  user/imp/tbemd/lib/msun/Makefile
  user/imp/tbemd/libexec/ypxfr/ypxfr.8
  user/imp/tbemd/sbin/bsdlabel/bsdlabel.c
  user/imp/tbemd/sbin/hastd/hast.conf.5
  user/imp/tbemd/sbin/hastd/hast.h
  user/imp/tbemd/sbin/hastd/hastd.c
  user/imp/tbemd/sbin/hastd/hastd.h
  user/imp/tbemd/sbin/hastd/hooks.c
  user/imp/tbemd/sbin/hastd/hooks.h
  user/imp/tbemd/sbin/hastd/parse.y
  user/imp/tbemd/sbin/hastd/pjdlog.c
  user/imp/tbemd/sbin/hastd/primary.c
  user/imp/tbemd/sbin/hastd/proto_tcp4.c
  user/imp/tbemd/sbin/hastd/secondary.c
  user/imp/tbemd/sbin/hastd/synch.h
  user/imp/tbemd/sbin/hastd/token.l
  user/imp/tbemd/sbin/ipfw/ipfw.8
  user/imp/tbemd/secure/lib/libcrypto/Makefile
  user/imp/tbemd/secure/lib/libcrypto/man/BIO_s_bio.3
  user/imp/tbemd/secure/lib/libcrypto/opensslconf-powerpc.h
  user/imp/tbemd/share/man/man4/ata.4
  user/imp/tbemd/share/man/man4/bpf.4
  user/imp/tbemd/share/man/man4/netgraph.4
  user/imp/tbemd/share/man/man4/ng_hci.4
  user/imp/tbemd/share/man/man4/re.4
  user/imp/tbemd/share/man/man5/src.conf.5
  user/imp/tbemd/share/man/man9/devstat.9
  user/imp/tbemd/share/man/man9/ieee80211_node.9
  user/imp/tbemd/sys/amd64/amd64/exception.S
  user/imp/tbemd/sys/amd64/amd64/machdep.c
  user/imp/tbemd/sys/amd64/amd64/trap.c
  user/imp/tbemd/sys/amd64/include/segments.h
  user/imp/tbemd/sys/boot/common/Makefile.inc
  user/imp/tbemd/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c
  user/imp/tbemd/sys/cddl/compat/opensolaris/sys/policy.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h
  user/imp/tbemd/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  user/imp/tbemd/sys/compat/x86bios/x86bios.c
  user/imp/tbemd/sys/compat/x86bios/x86bios.h
  user/imp/tbemd/sys/conf/files.amd64
  user/imp/tbemd/sys/conf/files.i386
  user/imp/tbemd/sys/dev/ahci/ahci.c
  user/imp/tbemd/sys/dev/ata/ata-pci.h
  user/imp/tbemd/sys/dev/ata/chipsets/ata-intel.c
  user/imp/tbemd/sys/dev/e1000/if_em.c
  user/imp/tbemd/sys/dev/e1000/if_em.h
  user/imp/tbemd/sys/dev/e1000/if_igb.c
  user/imp/tbemd/sys/dev/e1000/if_igb.h
  user/imp/tbemd/sys/dev/e1000/if_lem.c
  user/imp/tbemd/sys/dev/e1000/if_lem.h
  user/imp/tbemd/sys/dev/ed/if_ed_novell.c
  user/imp/tbemd/sys/dev/ed/if_ed_pci.c
  user/imp/tbemd/sys/dev/fb/vesa.c
  user/imp/tbemd/sys/dev/ichsmb/ichsmb_pci.c
  user/imp/tbemd/sys/dev/ichwd/ichwd.c
  user/imp/tbemd/sys/dev/ichwd/ichwd.h
  user/imp/tbemd/sys/dev/ixgb/if_ixgb.c
  user/imp/tbemd/sys/dev/ixgb/if_ixgb.h
  user/imp/tbemd/sys/dev/ixgbe/ixgbe.c
  user/imp/tbemd/sys/dev/ixgbe/ixgbe.h
  user/imp/tbemd/sys/dev/sound/pci/hda/hdac.c
  user/imp/tbemd/sys/fs/devfs/devfs_vnops.c
  user/imp/tbemd/sys/fs/unionfs/union_subr.c
  user/imp/tbemd/sys/geom/eli/g_eli.c
  user/imp/tbemd/sys/geom/eli/g_eli.h
  user/imp/tbemd/sys/i386/i386/exception.s
  user/imp/tbemd/sys/i386/i386/machdep.c
  user/imp/tbemd/sys/i386/i386/trap.c
  user/imp/tbemd/sys/i386/include/segments.h
  user/imp/tbemd/sys/i386/include/vm86.h
  user/imp/tbemd/sys/kern/kern_umtx.c
  user/imp/tbemd/sys/kern/subr_taskqueue.c
  user/imp/tbemd/sys/kern/sys_generic.c
  user/imp/tbemd/sys/kern/syscalls.master
  user/imp/tbemd/sys/kern/vfs_default.c
  user/imp/tbemd/sys/kern/vfs_mount.c
  user/imp/tbemd/sys/kern/vfs_subr.c
  user/imp/tbemd/sys/mips/include/atomic.h
  user/imp/tbemd/sys/mips/include/locore.h
  user/imp/tbemd/sys/mips/include/memdev.h
  user/imp/tbemd/sys/mips/include/pcb.h
  user/imp/tbemd/sys/mips/include/regnum.h
  user/imp/tbemd/sys/mips/include/ucontext.h
  user/imp/tbemd/sys/mips/rmi/board.c
  user/imp/tbemd/sys/mips/rmi/board.h
  user/imp/tbemd/sys/mips/rmi/files.xlr
  user/imp/tbemd/sys/mips/rmi/interrupt.h
  user/imp/tbemd/sys/mips/rmi/intr_machdep.c
  user/imp/tbemd/sys/mips/rmi/iodi.c
  user/imp/tbemd/sys/mips/rmi/msgring.h
  user/imp/tbemd/sys/mips/rmi/pic.h
  user/imp/tbemd/sys/mips/rmi/tick.c
  user/imp/tbemd/sys/mips/rmi/xlr_machdep.c
  user/imp/tbemd/sys/mips/rmi/xlr_pci.c
  user/imp/tbemd/sys/modules/dtrace/dtrace/Makefile
  user/imp/tbemd/sys/net/if_epair.c
  user/imp/tbemd/sys/netinet/tcp_input.c
  user/imp/tbemd/sys/netinet/tcp_subr.c
  user/imp/tbemd/sys/nfsserver/nfs_serv.c
  user/imp/tbemd/sys/powerpc/aim/mmu_oea.c
  user/imp/tbemd/sys/rpc/replay.c
  user/imp/tbemd/sys/sys/cdefs.h
  user/imp/tbemd/sys/sys/dtrace_bsd.h
  user/imp/tbemd/sys/sys/mman.h
  user/imp/tbemd/sys/sys/mount.h
  user/imp/tbemd/sys/sys/param.h
  user/imp/tbemd/sys/vm/vm_mmap.c
  user/imp/tbemd/tools/regression/poll/pipepoll.c
  user/imp/tbemd/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military   (contents, props changed)
  user/imp/tbemd/usr.bin/truss/Makefile
  user/imp/tbemd/usr.bin/truss/extern.h
  user/imp/tbemd/usr.bin/truss/main.c
  user/imp/tbemd/usr.bin/truss/powerpc-fbsd.c
  user/imp/tbemd/usr.bin/truss/powerpc64-fbsd.c
  user/imp/tbemd/usr.sbin/IPXrouted/IPXrouted.8
  user/imp/tbemd/usr.sbin/Makefile.mips
  user/imp/tbemd/usr.sbin/kldxref/Makefile
  user/imp/tbemd/usr.sbin/ypbind/ypbind.8
Directory Properties:
  user/imp/tbemd/   (props changed)
  user/imp/tbemd/cddl/contrib/opensolaris/   (props changed)
  user/imp/tbemd/contrib/bind9/   (props changed)
  user/imp/tbemd/contrib/ee/   (props changed)
  user/imp/tbemd/contrib/expat/   (props changed)
  user/imp/tbemd/contrib/file/   (props changed)
  user/imp/tbemd/contrib/gdb/   (props changed)
  user/imp/tbemd/contrib/gdtoa/   (props changed)
  user/imp/tbemd/contrib/gnu-sort/   (props changed)
  user/imp/tbemd/contrib/groff/   (props changed)
  user/imp/tbemd/contrib/less/   (props changed)
  user/imp/tbemd/contrib/libpcap/   (props changed)
  user/imp/tbemd/contrib/llvm/   (props changed)
  user/imp/tbemd/contrib/llvm/tools/clang/   (props changed)
  user/imp/tbemd/contrib/ncurses/   (props changed)
  user/imp/tbemd/contrib/netcat/   (props changed)
  user/imp/tbemd/contrib/ntp/   (props changed)
  user/imp/tbemd/contrib/one-true-awk/   (props changed)
  user/imp/tbemd/contrib/openbsm/   (props changed)
  user/imp/tbemd/contrib/openpam/   (props changed)
  user/imp/tbemd/contrib/pf/   (props changed)
  user/imp/tbemd/contrib/sendmail/   (props changed)
  user/imp/tbemd/contrib/tcpdump/   (props changed)
  user/imp/tbemd/contrib/tcsh/   (props changed)
  user/imp/tbemd/contrib/top/   (props changed)
  user/imp/tbemd/contrib/top/install-sh   (props changed)
  user/imp/tbemd/contrib/tzcode/stdtime/   (props changed)
  user/imp/tbemd/contrib/tzcode/zic/   (props changed)
  user/imp/tbemd/contrib/tzdata/   (props changed)
  user/imp/tbemd/contrib/wpa/   (props changed)
  user/imp/tbemd/crypto/openssh/   (props changed)
  user/imp/tbemd/crypto/openssl/   (props changed)
  user/imp/tbemd/lib/libc/   (props changed)
  user/imp/tbemd/lib/libc/stdtime/   (props changed)
  user/imp/tbemd/lib/libutil/   (props changed)
  user/imp/tbemd/lib/libz/   (props changed)
  user/imp/tbemd/sbin/   (props changed)
  user/imp/tbemd/sbin/ipfw/   (props changed)
  user/imp/tbemd/share/zoneinfo/   (props changed)
  user/imp/tbemd/sys/   (props changed)
  user/imp/tbemd/sys/amd64/include/xen/   (props changed)
  user/imp/tbemd/sys/cddl/contrib/opensolaris/   (props changed)
  user/imp/tbemd/sys/contrib/dev/acpica/   (props changed)
  user/imp/tbemd/sys/contrib/pf/   (props changed)
  user/imp/tbemd/sys/contrib/x86emu/   (props changed)
  user/imp/tbemd/sys/dev/xen/xenpci/   (props changed)
  user/imp/tbemd/usr.bin/csup/   (props changed)
  user/imp/tbemd/usr.bin/procstat/   (props changed)
  user/imp/tbemd/usr.sbin/zic/   (props changed)

Modified: user/imp/tbemd/Makefile.inc1
==============================================================================
--- user/imp/tbemd/Makefile.inc1	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/Makefile.inc1	Sat Aug 28 18:49:51 2010	(r211945)
@@ -1133,8 +1133,8 @@ _prereq_libs= gnu/lib/libssp/libssp_nons
 _startup_libs=	gnu/lib/csu
 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
 _startup_libs+=	lib/csu/${MACHINE_ARCH}-elf
-.elif exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf)
-_startup_libs+=	lib/csu/${MACHINE_CPUARCH}-elf
+.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
+_startup_libs+=	lib/csu/${MACHINE_ARCH}
 .else
 _startup_libs+=	lib/csu/${MACHINE_CPUARCH}
 .endif

Modified: user/imp/tbemd/Makefile.mips
==============================================================================
--- user/imp/tbemd/Makefile.mips	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/Makefile.mips	Sat Aug 28 18:49:51 2010	(r211945)
@@ -1,2 +1,5 @@
 # $FreeBSD$
+
+.if defined(TARGET_ABI) && ${TARGET_ABI} == "n64"
 MK_RESCUE=no
+.endif

Modified: user/imp/tbemd/bin/pax/tar.c
==============================================================================
--- user/imp/tbemd/bin/pax/tar.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/bin/pax/tar.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -1095,7 +1095,7 @@ name_split(char *name, int len)
 	 * to find the biggest piece to fit in the name field (or the smallest
 	 * prefix we can find)
 	 */
-	start = name + len - TNMSZ - 1;
+	start = name + len - TNMSZ;
 	while ((*start != '\0') && (*start != '/'))
 		++start;
 

Modified: user/imp/tbemd/bin/test/test.1
==============================================================================
--- user/imp/tbemd/bin/test/test.1	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/bin/test/test.1	Sat Aug 28 18:49:51 2010	(r211945)
@@ -302,7 +302,7 @@ manual page.
 The
 .Nm
 grammar is inherently ambiguous.
-In order to assure a degree of consistency,
+In order to ensure a degree of consistency,
 the cases described in the
 .St -p1003.2 ,
 section D11.2/4.62.4, standard

Modified: user/imp/tbemd/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- user/imp/tbemd/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -491,35 +491,37 @@ dump_metaslab_stats(metaslab_t *msp)
 static void
 dump_metaslab(metaslab_t *msp)
 {
-	char freebuf[5];
-	space_map_obj_t *smo = &msp->ms_smo;
 	vdev_t *vd = msp->ms_group->mg_vd;
 	spa_t *spa = vd->vdev_spa;
+	space_map_t *sm = &msp->ms_map;
+	space_map_obj_t *smo = &msp->ms_smo;
+	char freebuf[5];
 
-	nicenum(msp->ms_map.sm_size - smo->smo_alloc, freebuf);
+	nicenum(sm->sm_size - smo->smo_alloc, freebuf);
 
 	(void) printf(
 	    "\tvdev %5llu   offset %12llx   spacemap %6llu   free    %5s\n",
-	    (u_longlong_t)vd->vdev_id, (u_longlong_t)msp->ms_map.sm_start,
-	    (u_longlong_t)smo->smo_object, freebuf);
+	    (u_longlong_t)(sm->sm_start / sm->sm_size),
+	    (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf);
 
 	if (dump_opt['m'] > 1) {
 		mutex_enter(&msp->ms_lock);
-		VERIFY(space_map_load(&msp->ms_map, zfs_metaslab_ops,
-		    SM_FREE, &msp->ms_smo, spa->spa_meta_objset) == 0);
+		space_map_load_wait(sm);
+		if (!sm->sm_loaded)
+			VERIFY(space_map_load(sm, zfs_metaslab_ops,
+			    SM_FREE, smo, spa->spa_meta_objset) == 0);
 		dump_metaslab_stats(msp);
-		space_map_unload(&msp->ms_map);
+		space_map_unload(sm);
 		mutex_exit(&msp->ms_lock);
 	}
 
 	if (dump_opt['d'] > 5 || dump_opt['m'] > 2) {
-		ASSERT(msp->ms_map.sm_size == (1ULL << vd->vdev_ms_shift));
+		ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift));
 
 		mutex_enter(&msp->ms_lock);
-		dump_spacemap(spa->spa_meta_objset, smo, &msp->ms_map);
+		dump_spacemap(spa->spa_meta_objset, smo, sm);
 		mutex_exit(&msp->ms_lock);
 	}
-
 }
 
 static void

Modified: user/imp/tbemd/cddl/usr.sbin/Makefile
==============================================================================
--- user/imp/tbemd/cddl/usr.sbin/Makefile	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/cddl/usr.sbin/Makefile	Sat Aug 28 18:49:51 2010	(r211945)
@@ -3,6 +3,7 @@
 .include <bsd.own.mk>
 
 SUBDIR=	${_dtrace} \
+	${_dtruss} \
 	${_lockstat} \
 	${_zdb}
 
@@ -14,6 +15,7 @@ _zdb=	zdb
 
 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 _dtrace=	dtrace
+_dtruss=	dtruss
 _lockstat=	lockstat
 .endif
 

Modified: user/imp/tbemd/cddl/usr.sbin/dtruss/Makefile
==============================================================================
--- user/imp/tbemd/cddl/usr.sbin/dtruss/Makefile	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/cddl/usr.sbin/dtruss/Makefile	Sat Aug 28 18:49:51 2010	(r211945)
@@ -3,6 +3,6 @@
 .PATH: ${.CURDIR}/../../../cddl/contrib/dtracetoolkit
 
 SCRIPTS=dtruss
-NO_MAN=
+MAN=dtruss.1
 
 .include <bsd.prog.mk>

Copied: user/imp/tbemd/cddl/usr.sbin/dtruss/dtruss.1 (from r211943, head/cddl/usr.sbin/dtruss/dtruss.1)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/imp/tbemd/cddl/usr.sbin/dtruss/dtruss.1	Sat Aug 28 18:49:51 2010	(r211945, copy of r211943, head/cddl/usr.sbin/dtruss/dtruss.1)
@@ -0,0 +1,89 @@
+.\"
+.\" Copyright (c) 2010 The FreeBSD Foundation 
+.\" All rights reserved. 
+.\" 
+.\" This software was developed by Rui Paulo under sponsorship from the
+.\" FreeBSD Foundation. 
+.\"  
+.\" 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 AUTHOR 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 AUTHOR 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. 
+.\"
+.\" $FreeBSD$
+.\"
+.Dd August 26, 2010
+.Dt DTRUSS 1
+.Os
+.Sh NAME
+.Nm dtruss 
+.Nd Trace system calls and userland stacks using DTrace
+.Sh SYNOPSIS
+.Nm
+.Op Fl acdefholLs
+.Op Fl t Ar syscall
+.Op Fl n Ar name Fl p Ar pid Ar command
+.Sh DESCRIPTION
+The
+.Nm
+utility traces system calls and (optionally) userland stack traces for the
+specified programs.
+.Pp
+The following options are available:
+.Bl -tag -width indent
+.It Fl p Ar pid
+Trace the process with PID
+.Ar pid .
+.It Fl n Ar name
+Trace the process with name
+.Ar name .
+.It Fl t Ar syscall
+Trace the specified syscall only.
+.It Fl a
+Print all details.
+.It Fl c
+Print syscall counts.
+.It Fl d
+Print relative times (in microseconds).
+.It Fl e
+Print elapsed times (in microseconds).
+.It Fl f
+Follow the children processes.
+.It Fl l
+Force printing PID / TID.
+.It Fl o
+Print time spent on CPU.
+.It Fl s
+Print userland stack backtraces.
+.It Fl L
+Don't print PID / TID.
+.It Fl b Ar bufsize
+Specify the DTrace buffer size.
+.El
+.Sh EXIT STATUS
+.Ex -std
+.Sh SEE ALSO
+.Xr dtrace 1 
+.Sh HISTORY
+The
+.Nm
+utility comes from the DTraceToolkit and was first imported into
+.Fx 9.0 .
+.Sh AUTHORS
+.An Brendan Gregg

Modified: user/imp/tbemd/contrib/gcc/crtstuff.c
==============================================================================
--- user/imp/tbemd/contrib/gcc/crtstuff.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/contrib/gcc/crtstuff.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -191,11 +191,11 @@ DTOR_LIST_BEGIN;
 #elif defined(DTORS_SECTION_ASM_OP)
 asm (DTORS_SECTION_ASM_OP);
 STATIC func_ptr __DTOR_LIST__[1]
-  __attribute__ ((aligned(sizeof(func_ptr))))
+  __attribute__ ((used, aligned(sizeof(func_ptr))))
   = { (func_ptr) (-1) };
 #else
 STATIC func_ptr __DTOR_LIST__[1]
-  __attribute__((section(".dtors"), aligned(sizeof(func_ptr))))
+  __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr))))
   = { (func_ptr) (-1) };
 #endif /* __DTOR_LIST__ alternatives */
 
@@ -203,7 +203,7 @@ STATIC func_ptr __DTOR_LIST__[1]
 /* Stick a label at the beginning of the frame unwind info so we can register
    and deregister it with the exception handling library code.  */
 STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[]
-     __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4)))
+     __attribute__((used, section(EH_FRAME_SECTION_NAME), aligned(4)))
      = { };
 #endif /* USE_EH_FRAME_REGISTRY */
 
@@ -211,7 +211,7 @@ STATIC EH_FRAME_SECTION_CONST char __EH_
 /* Stick a label at the beginning of the java class registration info
    so we can register them properly.  */
 STATIC void *__JCR_LIST__[]
-  __attribute__ ((unused, section(JCR_SECTION_NAME), aligned(sizeof(void*))))
+  __attribute__ ((used, section(JCR_SECTION_NAME), aligned(sizeof(void*))))
   = { };
 #endif /* JCR_SECTION_NAME */
 
@@ -459,11 +459,11 @@ CTOR_LIST_END;
 static func_ptr force_to_data[1] __attribute__ ((__used__)) = { };
 asm (CTORS_SECTION_ASM_OP);
 STATIC func_ptr __CTOR_END__[1]
-  __attribute__((aligned(sizeof(func_ptr))))
+  __attribute__((used, aligned(sizeof(func_ptr))))
   = { (func_ptr) 0 };
 #else
 STATIC func_ptr __CTOR_END__[1]
-  __attribute__((section(".ctors"), aligned(sizeof(func_ptr))))
+  __attribute__((used, section(".ctors"), aligned(sizeof(func_ptr))))
   = { (func_ptr) 0 };
 #endif
 
@@ -472,11 +472,11 @@ DTOR_LIST_END;
 #elif defined(DTORS_SECTION_ASM_OP)
 asm (DTORS_SECTION_ASM_OP);
 STATIC func_ptr __DTOR_END__[1]
-  __attribute__ ((unused, aligned(sizeof(func_ptr))))
+  __attribute__ ((used, aligned(sizeof(func_ptr))))
   = { (func_ptr) 0 };
 #else
 STATIC func_ptr __DTOR_END__[1]
-  __attribute__((unused, section(".dtors"), aligned(sizeof(func_ptr))))
+  __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr))))
   = { (func_ptr) 0 };
 #endif
 
@@ -493,7 +493,7 @@ typedef short int32;
 #  error "Missing a 4 byte integer"
 # endif
 STATIC EH_FRAME_SECTION_CONST int32 __FRAME_END__[]
-     __attribute__ ((unused, section(EH_FRAME_SECTION_NAME),
+     __attribute__ ((used, section(EH_FRAME_SECTION_NAME),
 		     aligned(sizeof(int32))))
      = { 0 };
 #endif /* EH_FRAME_SECTION_NAME */
@@ -501,7 +501,7 @@ STATIC EH_FRAME_SECTION_CONST int32 __FR
 #ifdef JCR_SECTION_NAME
 /* Null terminate the .jcr section array.  */
 STATIC void *__JCR_END__[1] 
-   __attribute__ ((unused, section(JCR_SECTION_NAME),
+   __attribute__ ((used, section(JCR_SECTION_NAME),
 		   aligned(sizeof(void *))))
    = { 0 };
 #endif /* JCR_SECTION_NAME */

Modified: user/imp/tbemd/etc/defaults/rc.conf
==============================================================================
--- user/imp/tbemd/etc/defaults/rc.conf	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/etc/defaults/rc.conf	Sat Aug 28 18:49:51 2010	(r211945)
@@ -216,7 +216,7 @@ ifconfig_lo0="inet 127.0.0.1"	# default 
 #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias
 #ifconfig_fxp0_name="net0"	# Change interface name from fxp0 to net0.
 #vlans_fxp0="101 vlan0"		# vlan(4) interfaces for fxp0 device
-#create_arg_vlan0="vlan 102"	# vlan tag for vlan0 device
+#create_args_vlan0="vlan 102"	# vlan tag for vlan0 device
 #wlans_ath0="wlan0"		# wlan(4) interfaces for ath0 device
 #wlandebug_wlan0="scan+auth+assoc"	# Set debug flags with wlanddebug(8)
 #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry.

Modified: user/imp/tbemd/etc/periodic/daily/800.scrub-zfs
==============================================================================
--- user/imp/tbemd/etc/periodic/daily/800.scrub-zfs	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/etc/periodic/daily/800.scrub-zfs	Sat Aug 28 18:49:51 2010	(r211945)
@@ -53,7 +53,7 @@ case "$daily_scrub_zfs_enable" in
 		# Now minus last scrub (both in seconds) converted to days.
 		_scrub_diff=$(expr -e \( $(date +%s) - \
 		    $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24)
-		if [ ${_scrub_diff} -le ${_pool_threshold} ]; then
+		if [ ${_scrub_diff} -lt ${_pool_threshold} ]; then
 			echo "   skipping scrubbing of pool '${pool}':"
 			echo "      last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days"
 			continue
@@ -65,11 +65,11 @@ case "$daily_scrub_zfs_enable" in
 				echo "   scrubbing of pool '${pool}' already in progress, skipping:"
 				;;
 			*"none requested"*)
-				echo "   starting first scrubbing (after reboot) of pool '${pool}':"
+				echo "   starting first scrub (since reboot) of pool '${pool}':"
 				zpool scrub ${pool}
 				;;
 			*)
-				echo "   starting scrubbing of pool '${pool}':"
+				echo "   starting scrub of pool '${pool}':"
 				zpool scrub ${pool}
 				;;
 		esac

Modified: user/imp/tbemd/gnu/lib/libgomp/Makefile
==============================================================================
--- user/imp/tbemd/gnu/lib/libgomp/Makefile	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/gnu/lib/libgomp/Makefile	Sat Aug 28 18:49:51 2010	(r211945)
@@ -24,7 +24,7 @@ VERSION_MAP=	${SRCDIR}/libgomp.map
 
 # Target-specific OpenMP configuration
 .if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \
-    ${MACHINE_CPUARCH} == powerpc || \
+    ${MACHINE_ARCH} == powerpc || \
     (${MACHINE_CPUARCH} == mips && \
 	(!defined(TARGET_ABI) || ${TARGET_ABI} != "n64"))
 OMP_LOCK_ALIGN	=	4

Modified: user/imp/tbemd/lib/Makefile
==============================================================================
--- user/imp/tbemd/lib/Makefile	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/Makefile	Sat Aug 28 18:49:51 2010	(r211945)
@@ -114,8 +114,8 @@ SUBDIR=	${SUBDIR_ORDERED} \
 
 .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
 _csu=csu/${MACHINE_ARCH}-elf
-.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}-elf)
-_csu=csu/${MACHINE_CPUARCH}-elf
+.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
+_csu=csu/${MACHINE_ARCH}
 .elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
 _csu=csu/${MACHINE_CPUARCH}
 .else

Modified: user/imp/tbemd/lib/libc/Makefile
==============================================================================
--- user/imp/tbemd/lib/libc/Makefile	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/Makefile	Sat Aug 28 18:49:51 2010	(r211945)
@@ -5,10 +5,11 @@ SHLIBDIR?= /lib
 
 .include <bsd.own.mk>
 
-# We have to special case powerpc and powerpc64, since they mostly have
-# the same source implementation.  libc is very different due to large
-# ABI differences.
-.if ${MACHINE_ARCH} == "powerpc"
+# Pick the current architecture directory for libc. In general, this is
+# named MACHINE_CPUARCH, but some ABIs are different enough to require
+# their own libc, so allow a directory named MACHINE_ARCH to override this.
+
+.if exists(${.CURDIR}/${MACHINE_ARCH})
 LIBC_ARCH=${MACHINE_ARCH}
 .else
 LIBC_ARCH=${MACHINE_CPUARCH}

Modified: user/imp/tbemd/lib/libc/net/ethers.3
==============================================================================
--- user/imp/tbemd/lib/libc/net/ethers.3	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/net/ethers.3	Sat Aug 28 18:49:51 2010	(r211945)
@@ -189,7 +189,7 @@ unable to find a match in the
 .Pa /etc/ethers
 database.
 .Sh NOTES
-The user must insure that the hostname strings passed to the
+The user must ensure that the hostname strings passed to the
 .Fn ether_line ,
 .Fn ether_ntohost
 and

Modified: user/imp/tbemd/lib/libc/net/eui64.3
==============================================================================
--- user/imp/tbemd/lib/libc/net/eui64.3	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/net/eui64.3	Sat Aug 28 18:49:51 2010	(r211945)
@@ -189,7 +189,7 @@ unable to find a match in the
 .Pa /etc/eui64
 database.
 .Sh NOTES
-The user must insure that the hostname strings passed to the
+The user must ensure that the hostname strings passed to the
 .\" .Fn eui64_line ,
 .Fn eui64_ntohost
 and

Modified: user/imp/tbemd/lib/libc/net/sctp_send.3
==============================================================================
--- user/imp/tbemd/lib/libc/net/sctp_send.3	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/net/sctp_send.3	Sat Aug 28 18:49:51 2010	(r211945)
@@ -191,7 +191,7 @@ If that many milliseconds elapse
 and the peer has not acknowledged the data, the data will be
 skipped and no longer transmitted.
 Note that this policy does
-not even assure that the data will ever be sent.
+not even ensure that the data will ever be sent.
 In times of a congestion
 with large amounts of data being queued, the 
 .Fa sinfo->sinfo_timetolive
@@ -218,7 +218,7 @@ policy transforms the
 .Fa sinfo->sinfo_timetolive 
 into a number of retransmissions to allow.
 This policy
-always assures that at a minimum one send attempt is
+always ensures that at a minimum one send attempt is
 made of the data.
 After which no more than 
 .Fa sinfo->sinfo_timetolive

Modified: user/imp/tbemd/lib/libc/net/sctp_sendmsg.3
==============================================================================
--- user/imp/tbemd/lib/libc/net/sctp_sendmsg.3	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/net/sctp_sendmsg.3	Sat Aug 28 18:49:51 2010	(r211945)
@@ -203,7 +203,7 @@ If that many milliseconds elapse
 and the peer has not acknowledged the data, the data will be
 skipped and no longer transmitted.
 Note that this policy does
-not even assure that the data will ever be sent.
+not even ensure that the data will ever be sent.
 In times of a congestion
 with large amounts of data being queued, the 
 .Fa timetolive
@@ -230,7 +230,7 @@ policy transforms the
 .Fa timetolive 
 into a number of retransmissions to allow.
 This policy
-always assures that at a minimum one send attempt is
+always ensures that at a minimum one send attempt is
 made of the data.
 After which no more than 
 .Fa timetolive

Modified: user/imp/tbemd/lib/libc/stdio/printf.3
==============================================================================
--- user/imp/tbemd/lib/libc/stdio/printf.3	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/stdio/printf.3	Sat Aug 28 18:49:51 2010	(r211945)
@@ -849,7 +849,7 @@ and
 .Fn vsprintf
 assume an infinitely long string,
 callers must be careful not to overflow the actual space;
-this is often hard to assure.
+this is often hard to ensure.
 For safety, programmers should use the
 .Fn snprintf
 interface instead.

Modified: user/imp/tbemd/lib/libc/stdlib/atexit.c
==============================================================================
--- user/imp/tbemd/lib/libc/stdlib/atexit.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/stdlib/atexit.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -200,6 +200,6 @@ __cxa_finalize(void *dso)
 	if (dso == NULL)
 		_MUTEX_DESTROY(&atexit_mutex);
 
-	if (&__pthread_cxa_finalize != NULL)
+	if (has_phdr && &__pthread_cxa_finalize != NULL)
 		__pthread_cxa_finalize(&phdr_info);
 }

Modified: user/imp/tbemd/lib/libc/stdlib/malloc.3
==============================================================================
--- user/imp/tbemd/lib/libc/stdlib/malloc.3	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/stdlib/malloc.3	Sat Aug 28 18:49:51 2010	(r211945)
@@ -266,7 +266,7 @@ options are enabled, the allocator prefe
 but allocation only fails if memory cannot be acquired via either method.
 If neither option is enabled, then the
 .Dq M
-option is implicitly enabled in order to assure that there is a method for
+option is implicitly enabled in order to ensure that there is a method for
 acquiring memory.
 .It N
 Double/halve the number of arenas.
@@ -437,7 +437,7 @@ rounded up to the nearest multiple of th
 .Pp
 Allocations are packed tightly together, which can be an issue for
 multi-threaded applications.
-If you need to assure that allocations do not suffer from cacheline sharing,
+If you need to ensure that allocations do not suffer from cacheline sharing,
 round your allocation requests up to the nearest multiple of the cacheline
 size.
 .Sh DEBUGGING MALLOC PROBLEMS

Modified: user/imp/tbemd/lib/libc/sys/mmap.2
==============================================================================
--- user/imp/tbemd/lib/libc/sys/mmap.2	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/sys/mmap.2	Sat Aug 28 18:49:51 2010	(r211945)
@@ -28,7 +28,7 @@
 .\"	@(#)mmap.2	8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd November 6, 2009
+.Dd August 28, 2010
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -211,6 +211,19 @@ implements a coherent file system buffer
 However, it may be
 used to associate dirty VM pages with file system buffers and thus cause
 them to be flushed to physical media sooner rather than later.
+.It Dv MAP_PREFAULT_READ
+Immediately update the calling process's lowest-level virtual address
+translation structures, such as its page table, so that every memory
+resident page within the region is mapped for read access.
+Ordinarily these structures are updated lazily.
+The effect of this option is to eliminate any soft faults that would
+otherwise occur on the initial read accesses to the region.
+Although this option does not preclude
+.Fa prot
+from including
+.Dv PROT_WRITE ,
+it does not eliminate soft faults on the initial write accesses to the
+region.
 .It Dv MAP_PRIVATE
 Modifications are private.
 .It Dv MAP_SHARED

Modified: user/imp/tbemd/lib/libc/sys/semop.2
==============================================================================
--- user/imp/tbemd/lib/libc/sys/semop.2	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libc/sys/semop.2	Sat Aug 28 18:49:51 2010	(r211945)
@@ -222,7 +222,7 @@ When a process
 exits, either voluntarily or involuntarily, the adjust on exit value
 for each semaphore is added to the semaphore's value.
 This can
-be used to insure that a resource is released if a process terminates
+be used to ensure that a resource is released if a process terminates
 unexpectedly.
 .Sh RETURN VALUES
 .Rv -std semop

Modified: user/imp/tbemd/lib/libipx/ipx.3
==============================================================================
--- user/imp/tbemd/lib/libipx/ipx.3	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libipx/ipx.3	Sat Aug 28 18:49:51 2010	(r211945)
@@ -70,7 +70,7 @@ trailing
 .Ql H
 appended.
 .Pp
-An effort has been made to insure that
+An effort has been made to ensure that
 .Fn ipx_addr
 be compatible with most formats in common use.
 It will first separate an address into 1 to 3 fields using a single delimiter

Modified: user/imp/tbemd/lib/libkvm/Makefile
==============================================================================
--- user/imp/tbemd/lib/libkvm/Makefile	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libkvm/Makefile	Sat Aug 28 18:49:51 2010	(r211945)
@@ -9,13 +9,19 @@ CFLAGS+=-DLIBC_SCCS -I${.CURDIR}
 CFLAGS+=-DSUN4V
 .endif
 
+.if exists(${.CURDIR}/kvm_${MACHINE_ARCH}.c)
+KVM_ARCH=${MACHINE_ARCH}
+.else
+KVM_ARCH=${MACHINE_CPUARCH}
+.endif
+
 WARNS?=	0
 
-SRCS=	kvm.c kvm_${MACHINE_CPUARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \
+SRCS=	kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \
 	kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c
 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
     ${MACHINE_CPUARCH} == "arm"
-SRCS+=	kvm_minidump_${MACHINE_CPUARCH}.c
+SRCS+=	kvm_minidump_${KVM_ARCH}.c
 .endif
 INCS=	kvm.h
 

Modified: user/imp/tbemd/lib/libthr/thread/thr_exit.c
==============================================================================
--- user/imp/tbemd/lib/libthr/thread/thr_exit.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libthr/thread/thr_exit.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -55,16 +55,6 @@ _thread_exit(const char *fname, int line
 	abort();
 }
 
-/*
- * Only called when a thread is cancelled.  It may be more useful
- * to call it from pthread_exit() if other ways of asynchronous or
- * abnormal thread termination can be found.
- */
-void
-_thr_exit_cleanup(void)
-{
-}
-
 void
 _pthread_exit(void *status)
 {
@@ -84,8 +74,6 @@ _pthread_exit(void *status)
 	curthread->cancel_enable = 0;
 	curthread->cancel_async = 0;
 	
-	_thr_exit_cleanup();
-
 	/* Save the return value: */
 	curthread->ret = status;
 	while (curthread->cleanup != NULL) {

Modified: user/imp/tbemd/lib/libthr/thread/thr_fork.c
==============================================================================
--- user/imp/tbemd/lib/libthr/thread/thr_fork.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libthr/thread/thr_fork.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -114,6 +114,7 @@ __pthread_cxa_finalize(struct dl_phdr_in
 		}
 	}
 	THR_UMUTEX_UNLOCK(curthread, &_thr_atfork_lock);
+	_thr_tsd_unload(phdr_info);
 }
 
 __weak_reference(_fork, fork);

Modified: user/imp/tbemd/lib/libthr/thread/thr_private.h
==============================================================================
--- user/imp/tbemd/lib/libthr/thread/thr_private.h	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libthr/thread/thr_private.h	Sat Aug 28 18:49:51 2010	(r211945)
@@ -623,7 +623,6 @@ void	_mutex_fork(struct pthread *curthre
 void	_libpthread_init(struct pthread *) __hidden;
 struct pthread *_thr_alloc(struct pthread *) __hidden;
 void	_thread_exit(const char *, int, const char *) __hidden __dead2;
-void	_thr_exit_cleanup(void) __hidden;
 int	_thr_ref_add(struct pthread *, struct pthread *, int) __hidden;
 void	_thr_ref_delete(struct pthread *, struct pthread *) __hidden;
 void	_thr_ref_delete_unlocked(struct pthread *, struct pthread *) __hidden;
@@ -635,7 +634,6 @@ void	_thr_stack_free(struct pthread_attr
 void	_thr_free(struct pthread *, struct pthread *) __hidden;
 void	_thr_gc(struct pthread *) __hidden;
 void    _thread_cleanupspecific(void) __hidden;
-void    _thread_dump_info(void) __hidden;
 void	_thread_printf(int, const char *, ...) __hidden;
 void	_thr_spinlock_init(void) __hidden;
 void	_thr_cancel_enter(struct pthread *) __hidden;
@@ -671,9 +669,6 @@ int	_schedparam_to_rtp(int policy, const
 void	_thread_bp_create(void);
 void	_thread_bp_death(void);
 int	_sched_yield(void);
-void	_thr_sem_prefork(void);
-void	_thr_sem_postfork(void);
-void	_thr_sem_child_postfork(void);
 
 void	_pthread_cleanup_push(void (*)(void *), void *);
 void	_pthread_cleanup_pop(int);
@@ -744,6 +739,7 @@ _thr_check_init(void)
 
 struct dl_phdr_info;
 void __pthread_cxa_finalize(struct dl_phdr_info *phdr_info);
+void _thr_tsd_unload(struct dl_phdr_info *phdr_info) __hidden;
 
 __END_DECLS
 

Modified: user/imp/tbemd/lib/libthr/thread/thr_rtld.c
==============================================================================
--- user/imp/tbemd/lib/libthr/thread/thr_rtld.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libthr/thread/thr_rtld.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -81,8 +81,11 @@ static void
 _thr_rtld_lock_destroy(void *lock)
 {
 	int locki;
+	size_t i;
 
 	locki = (struct rtld_lock *)lock - &lock_place[0];
+	for (i = 0; i < sizeof(struct rtld_lock); ++i)
+		((char *)lock)[i] = 0;
 	busy_places &= ~(1 << locki);
 }
 
@@ -149,8 +152,8 @@ _thr_rtld_lock_release(void *lock)
 	
 	state = l->lock.rw_state;
 	if (_thr_rwlock_unlock(&l->lock) == 0) {
-		curthread->rdlock_count--;
 		if ((state & URWLOCK_WRITE_OWNER) == 0) {
+			curthread->rdlock_count--;
 			THR_CRITICAL_LEAVE(curthread);
 		} else {
 			_thr_signal_unblock(curthread);

Modified: user/imp/tbemd/lib/libthr/thread/thr_spec.c
==============================================================================
--- user/imp/tbemd/lib/libthr/thread/thr_spec.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/libthr/thread/thr_spec.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -36,6 +36,7 @@
 #include <errno.h>
 #include <pthread.h>
 #include "un-namespace.h"
+#include "libc_private.h"
 
 #include "thr_private.h"
 
@@ -235,3 +236,23 @@ _pthread_getspecific(pthread_key_t key)
 		data = NULL;
 	return (__DECONST(void *, data));
 }
+
+void
+_thr_tsd_unload(struct dl_phdr_info *phdr_info)
+{
+	struct pthread *curthread = _get_curthread();
+	void (*destructor)(void *);
+	int key;
+
+	THR_LOCK_ACQUIRE(curthread, &_keytable_lock);
+	for (key = 0; key < PTHREAD_KEYS_MAX; key++) {
+		if (_thread_keytable[key].allocated) {
+			destructor = _thread_keytable[key].destructor;
+			if (destructor != NULL) {
+				if (__elf_phdr_match_addr(phdr_info, destructor))
+					_thread_keytable[key].destructor = NULL;
+			}
+		}
+	}
+	THR_LOCK_RELEASE(curthread, &_keytable_lock);
+}

Modified: user/imp/tbemd/lib/msun/Makefile
==============================================================================
--- user/imp/tbemd/lib/msun/Makefile	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/lib/msun/Makefile	Sat Aug 28 18:49:51 2010	(r211945)
@@ -75,8 +75,13 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c 
 
 # Location of fpmath.h and _fpmath.h
 LIBCDIR=	${.CURDIR}/../libc
+.if exists(${LIBCDIR}/${MACHINE_ARCH})
+LIBC_ARCH=${MACHINE_ARCH}
+.else
+LIBC_ARCH=${MACHINE_CPUARCH}
+.endif
 CFLAGS+=	-I${.CURDIR}/src -I${LIBCDIR}/include \
-	-I${LIBCDIR}/${MACHINE_CPUARCH}
+	-I${LIBCDIR}/${LIBC_ARCH}
 SYM_MAPS+=	${.CURDIR}/Symbol.map
 
 VERSION_DEF=	${LIBCDIR}/Versions.def

Modified: user/imp/tbemd/libexec/ypxfr/ypxfr.8
==============================================================================
--- user/imp/tbemd/libexec/ypxfr/ypxfr.8	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/libexec/ypxfr/ypxfr.8	Sat Aug 28 18:49:51 2010	(r211945)
@@ -234,7 +234,7 @@ Specify the name of the host from which 
 .Tn NIS
 maps.
 This option
-is used to insure that
+is used to ensure that
 .Nm
 only copies maps from the
 .Tn NIS

Modified: user/imp/tbemd/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- user/imp/tbemd/sbin/bsdlabel/bsdlabel.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/sbin/bsdlabel/bsdlabel.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$");
 #include "pathnames.h"
 
 static void	makelabel(const char *, struct disklabel *);
+static int	geom_bsd_available(void);
 static int	writelabel(void);
 static int	readlabel(int flag);
 static void	display(FILE *, const struct disklabel *);
@@ -379,10 +380,33 @@ readboot(void)
 }
 
 static int
+geom_bsd_available(void)
+{
+	struct gclass *class;
+	struct gmesh mesh;
+	int error;
+
+	error = geom_gettree(&mesh);
+	if (error != 0)
+		errc(1, error, "Cannot get GEOM tree");
+
+	LIST_FOREACH(class, &mesh.lg_class, lg_class) {
+		if (strcmp(class->lg_name, "BSD") == 0) {
+			geom_deletetree(&mesh);
+			return (1);
+		}
+	}
+
+	geom_deletetree(&mesh);
+
+	return (0);
+}
+
+static int
 writelabel(void)
 {
 	uint64_t *p, sum;
-	int i, fd;
+	int i, fd, serrno;
 	struct gctl_req *grq;
 	char const *errstr;
 	struct disklabel *lp = &lab;
@@ -416,6 +440,13 @@ writelabel(void)
 		if (is_file) {
 			warn("cannot open file %s for writing label", specname);
 			return(1);
+		} else
+			serrno = errno;
+
+		/* Give up if GEOM_BSD is not available. */
+		if (geom_bsd_available() == 0) {
+			warnc(serrno, "%s", specname);
+			return (1);
 		}
 
 		grq = gctl_get_handle();

Modified: user/imp/tbemd/sbin/hastd/hast.conf.5
==============================================================================
--- user/imp/tbemd/sbin/hastd/hast.conf.5	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/sbin/hastd/hast.conf.5	Sat Aug 28 18:49:51 2010	(r211945)
@@ -1,4 +1,5 @@
 .\" Copyright (c) 2010 The FreeBSD Foundation
+.\" Copyright (c) 2010 Pawel Jakub Dawidek <pjd at FreeBSD.org>
 .\" All rights reserved.
 .\"
 .\" This software was developed by Pawel Jakub Dawidek under sponsorship from
@@ -27,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 5, 2010
+.Dd August 27, 2010
 .Dt HAST.CONF 5
 .Os
 .Sh NAME
@@ -59,6 +60,7 @@ control <addr>
 listen <addr>
 replication <mode>
 timeout <seconds>
+exec <path>
 
 on <node> {
 	# Node section
@@ -78,6 +80,7 @@ resource <name> {
 	name <name>
 	local <path>
 	timeout <seconds>
+	exec <path>
 
 	on <node> {
 		# Resource-node section
@@ -203,6 +206,41 @@ replication mode is currently not implem
 Connection timeout in seconds.
 The default value is
 .Va 5 .
+.It Ic exec Aq path
+.Pp
+Execute the given program on various HAST events.
+Below is the list of currently implemented events and arguments the given
+program is executed with:
+.Bl -tag -width ".Ic xxxx"
+.It Ic "<path> syncstart <resource>"
+.Pp
+Executed on primary node when synchronization process of secondary node is
+started.
+.Pp
+.It Ic "<path> syncdone <resource>"
+.Pp
+Executed on primary node when synchronization process of secondary node is
+completed successfully.
+.Pp
+.It Ic "<path> syncintr <resource>"
+.Pp
+Executed on primary node when synchronization process of secondary node is
+interrupted, most likely due to secondary node outage or connection failure
+between the nodes.
+.Pp
+.El
+The
+.Aq path
+argument should contain full path to executable program.
+If the given program exits with code different than
+.Va 0 ,
+.Nm hastd
+will log it as an error.
+.Pp
+The
+.Aq resource
+argument is resource name from the configuration file.
+.Pp
 .It Ic name Aq name
 .Pp
 GEOM provider name that will appear as

Modified: user/imp/tbemd/sbin/hastd/hast.h
==============================================================================
--- user/imp/tbemd/sbin/hastd/hast.h	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/sbin/hastd/hast.h	Sat Aug 28 18:49:51 2010	(r211945)
@@ -48,7 +48,12 @@
 
 #include "proto.h"
 
-#define	HAST_PROTO_VERSION	0
+/*
+ * Version history:
+ * 0 - initial version
+ * 1 - HIO_KEEPALIVE added
+ */
+#define	HAST_PROTO_VERSION	1
 
 #define	EHAST_OK		0
 #define	EHAST_NOENTRY		1
@@ -74,6 +79,7 @@
 #define	HIO_WRITE		2
 #define	HIO_DELETE		3
 #define	HIO_FLUSH		4
+#define	HIO_KEEPALIVE		5
 
 #define	HAST_TIMEOUT	5
 #define	HAST_CONFIG	"/etc/hast.conf"
@@ -121,6 +127,8 @@ struct hast_resource {
 	int	hr_extentsize;
 	/* Maximum number of extents that are kept dirty. */
 	int	hr_keepdirty;
+	/* Path to a program to execute on various events. */
+	char	hr_exec[PATH_MAX];
 
 	/* Path to local component. */
 	char	hr_localpath[PATH_MAX];

Modified: user/imp/tbemd/sbin/hastd/hastd.c
==============================================================================
--- user/imp/tbemd/sbin/hastd/hastd.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/sbin/hastd/hastd.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -62,7 +62,7 @@ const char *cfgpath = HAST_CONFIG;
 /* Hastd configuration. */
 static struct hastd_config *cfg;
 /* Was SIGCHLD signal received? */
-static bool sigchld_received = false;
+bool sigchld_received = false;
 /* Was SIGHUP signal received? */
 bool sighup_received = false;
 /* Was SIGINT or SIGTERM signal received? */
@@ -82,6 +82,10 @@ sighandler(int sig)
 {
 
 	switch (sig) {
+	case SIGINT:
+	case SIGTERM:
+		sigexit_received = true;
+		break;
 	case SIGCHLD:
 		sigchld_received = true;
 		break;
@@ -189,6 +193,8 @@ resource_needs_restart(const struct hast
 			return (true);
 		if (res0->hr_timeout != res1->hr_timeout)
 			return (true);
+		if (strcmp(res0->hr_exec, res1->hr_exec) != 0)
+			return (true);
 	}
 	return (false);
 }
@@ -211,6 +217,8 @@ resource_needs_reload(const struct hast_
 		return (true);
 	if (res0->hr_timeout != res1->hr_timeout)
 		return (true);
+	if (strcmp(res0->hr_exec, res1->hr_exec) != 0)
+		return (true);
 	return (false);
 }
 
@@ -370,6 +378,25 @@ failed:
 }
 
 static void
+terminate_workers(void)
+{
+	struct hast_resource *res;
+
+	pjdlog_info("Termination signal received, exiting.");
+	TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
+		if (res->hr_workerpid == 0)
+			continue;
+		pjdlog_info("Terminating worker process (resource=%s, role=%s, pid=%u).",
+		    res->hr_name, role2str(res->hr_role), res->hr_workerpid);
+		if (kill(res->hr_workerpid, SIGTERM) == 0)
+			continue;
+		pjdlog_errno(LOG_WARNING,
+		    "Unable to send signal to worker process (resource=%s, role=%s, pid=%u).",
+		    res->hr_name, role2str(res->hr_role), res->hr_workerpid);
+	}
+}
+
+static void
 listen_accept(void)
 {
 	struct hast_resource *res;
@@ -595,6 +622,11 @@ main_loop(void)
 	int cfd, lfd, maxfd, ret;
 
 	for (;;) {
+		if (sigexit_received) {
+			sigexit_received = false;
+			terminate_workers();
+			exit(EX_OK);
+		}
 		if (sigchld_received) {
 			sigchld_received = false;
 			child_exit();
@@ -688,6 +720,8 @@ main(int argc, char *argv[])
 	cfg = yy_config_parse(cfgpath, true);
 	assert(cfg != NULL);
 
+	signal(SIGINT, sighandler);
+	signal(SIGTERM, sighandler);
 	signal(SIGHUP, sighandler);
 	signal(SIGCHLD, sighandler);
 

Modified: user/imp/tbemd/sbin/hastd/hastd.h
==============================================================================
--- user/imp/tbemd/sbin/hastd/hastd.h	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/sbin/hastd/hastd.h	Sat Aug 28 18:49:51 2010	(r211945)
@@ -40,7 +40,7 @@
 #include "hast.h"
 
 extern const char *cfgpath;
-extern bool sigexit_received, sighup_received;
+extern bool sigchld_received, sigexit_received, sighup_received;
 extern struct pidfh *pfh;
 
 void hastd_primary(struct hast_resource *res);

Modified: user/imp/tbemd/sbin/hastd/hooks.c
==============================================================================
--- user/imp/tbemd/sbin/hastd/hooks.c	Sat Aug 28 17:59:51 2010	(r211944)
+++ user/imp/tbemd/sbin/hastd/hooks.c	Sat Aug 28 18:49:51 2010	(r211945)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2010 The FreeBSD Foundation
+ * Copyright (c) 2010 Pawel Jakub Dawidek <pjd at FreeBSD.org>
  * All rights reserved.
  *
  * This software was developed by Pawel Jakub Dawidek under sponsorship from
@@ -31,21 +32,55 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/types.h>
+#include <sys/sysctl.h>
 #include <sys/wait.h>
 
 #include <assert.h>
+#include <errno.h>
 #include <fcntl.h>
+#include <libgen.h>
+#include <paths.h>
+#include <signal.h>
+#include <stdbool.h>

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-user mailing list