From owner-svn-src-stable-9@FreeBSD.ORG Sun Sep 29 07:42:25 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BD0628CD; Sun, 29 Sep 2013 07:42:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA9742A64; Sun, 29 Sep 2013 07:42:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8T7gP7o099886; Sun, 29 Sep 2013 07:42:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8T7gPac099885; Sun, 29 Sep 2013 07:42:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201309290742.r8T7gPac099885@svn.freebsd.org> From: Xin LI Date: Sun, 29 Sep 2013 07:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255934 - in stable: 8/lib/libedit 9/lib/libedit X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 07:42:25 -0000 Author: delphij Date: Sun Sep 29 07:42:25 2013 New Revision: 255934 URL: http://svnweb.freebsd.org/changeset/base/255934 Log: MFC r255891: Import NetBSD readline.c,v 1.104: do not crash with add_history(NULL). Modified: stable/9/lib/libedit/readline.c Directory Properties: stable/9/lib/libedit/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/libedit/readline.c Directory Properties: stable/8/lib/libedit/ (props changed) Modified: stable/9/lib/libedit/readline.c ============================================================================== --- stable/9/lib/libedit/readline.c Sun Sep 29 01:05:00 2013 (r255933) +++ stable/9/lib/libedit/readline.c Sun Sep 29 07:42:25 2013 (r255934) @@ -1363,6 +1363,9 @@ add_history(const char *line) TYPE(HistEvent) ev; const Char *wline; + if (line == NULL) + return 0; + if (h == NULL || e == NULL) rl_initialize(); From owner-svn-src-stable-9@FreeBSD.ORG Sun Sep 29 20:35:41 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C6796476; Sun, 29 Sep 2013 20:35:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0BFC27C4; Sun, 29 Sep 2013 20:35:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8TKZfij035353; Sun, 29 Sep 2013 20:35:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8TKZdOQ035322; Sun, 29 Sep 2013 20:35:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201309292035.r8TKZdOQ035322@svn.freebsd.org> From: Dimitry Andric Date: Sun, 29 Sep 2013 20:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255946 - in stable/9/contrib/llvm/lib: CodeGen/SelectionDAG Target/AArch64 Target/ARM Target/Hexagon Target/MSP430 Target/Mips Target/NVPTX Target/PowerPC Target/R600 Target/Sparc Targ... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 20:35:41 -0000 Author: dim Date: Sun Sep 29 20:35:38 2013 New Revision: 255946 URL: http://svnweb.freebsd.org/changeset/base/255946 Log: MFC r255804: Pull in r191165 from upstream llvm trunk: ISelDAG: spot chain cycles involving MachineNodes Previously, the DAGISel function WalkChainUsers was spotting that it had entered already-selected territory by whether a node was a MachineNode (amongst other things). Since it's fairly common practice to insert MachineNodes during ISelLowering, this was not the correct check. Looking around, it seems that other nodes get their NodeId set to -1 upon selection, so this makes sure the same thing happens to all MachineNodes and uses that characteristic to determine whether we should stop looking for a loop during selection. This should fix PR15840. Specifically, this fixes the long-standing assertion failure when compiling the multimedia/gstreamer port on i386. Thanks to Tijl Coosemans for his help in getting upstream to fix it. Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp ============================================================================== --- stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1736,15 +1736,15 @@ WalkChainUsers(const SDNode *ChainedNode SDNode *User = *UI; + if (User->getOpcode() == ISD::HANDLENODE) // Root of the graph. + continue; + // If we see an already-selected machine node, then we've gone beyond the // pattern that we're selecting down into the already selected chunk of the // DAG. - if (User->isMachineOpcode() || - User->getOpcode() == ISD::HANDLENODE) // Root of the graph. - continue; - unsigned UserOpcode = User->getOpcode(); - if (UserOpcode == ISD::CopyToReg || + if (User->isMachineOpcode() || + UserOpcode == ISD::CopyToReg || UserOpcode == ISD::CopyFromReg || UserOpcode == ISD::INLINEASM || UserOpcode == ISD::EH_LABEL || Modified: stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -395,6 +395,7 @@ SDNode *AArch64DAGToDAGISel::Select(SDNo if (Node->isMachineOpcode()) { DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -2546,8 +2546,10 @@ SDNode *ARMDAGToDAGISel::SelectAtomic64( SDNode *ARMDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1334,8 +1334,10 @@ SDNode *HexagonDAGToDAGISel::SelectAdd(S SDNode *HexagonDAGToDAGISel::Select(SDNode *N) { - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { Modified: stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -394,6 +394,7 @@ SDNode *MSP430DAGToDAGISel::Select(SDNod DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -97,6 +97,7 @@ SDNode* MipsDAGToDAGISel::Select(SDNode // If we have a custom node, we already have selected! if (Node->isMachineOpcode()) { DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return NULL; } Modified: stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -91,8 +91,10 @@ NVPTXDAGToDAGISel::NVPTXDAGToDAGISel(NVP /// expanded, promoted and normal instructions. SDNode *NVPTXDAGToDAGISel::Select(SDNode *N) { - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } SDNode *ResNode = NULL; switch (N->getOpcode()) { Modified: stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -895,8 +895,10 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDN // target-specific node if it hasn't already been changed. SDNode *PPCDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -158,6 +158,7 @@ bool AMDGPUDAGToDAGISel::SelectADDR64(SD SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) { unsigned int Opc = N->getOpcode(); if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. } switch (Opc) { Modified: stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -137,8 +137,10 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDV SDNode *SparcDAGToDAGISel::Select(SDNode *N) { DebugLoc dl = N->getDebugLoc(); - if (N->isMachineOpcode()) + if (N->isMachineOpcode()) { + N->setNodeId(-1); return NULL; // Already selected. + } switch (N->getOpcode()) { default: break; Modified: stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -540,6 +540,7 @@ SDNode *SystemZDAGToDAGISel::Select(SDNo // If we have a custom node, we already have selected! if (Node->isMachineOpcode()) { DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n"); + Node->setNodeId(-1); return 0; } Modified: stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Sep 29 20:21:34 2013 (r255945) +++ stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Sep 29 20:35:38 2013 (r255946) @@ -1988,6 +1988,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode * if (Node->isMachineOpcode()) { DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << '\n'); + Node->setNodeId(-1); return NULL; // Already selected. } From owner-svn-src-stable-9@FreeBSD.ORG Mon Sep 30 17:57:23 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5F20B8A1; Mon, 30 Sep 2013 17:57:23 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3247F28C3; Mon, 30 Sep 2013 17:57:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UHvNSs025530; Mon, 30 Sep 2013 17:57:23 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8UHvNki025529; Mon, 30 Sep 2013 17:57:23 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201309301757.r8UHvNki025529@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 30 Sep 2013 17:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255952 - stable/9/sys/fs/cd9660 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:57:23 -0000 Author: jmg Date: Mon Sep 30 17:57:22 2013 New Revision: 255952 URL: http://svnweb.freebsd.org/changeset/base/255952 Log: MFC: r255866, r255867 fix a bug where we access a bread buffer after we have brelse'd it... The kernel normally didn't unmap/context switch away before we accessed the buffer most of the time, but under heavy I/O pressure and lots of mount/unmounting this would cause a fault on nofault panic... NULL stale pointers (should be a no-op as they should no longer be used)... Modified: stable/9/sys/fs/cd9660/cd9660_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- stable/9/sys/fs/cd9660/cd9660_vfsops.c Mon Sep 30 17:40:39 2013 (r255951) +++ stable/9/sys/fs/cd9660/cd9660_vfsops.c Mon Sep 30 17:57:22 2013 (r255952) @@ -369,6 +369,9 @@ iso_mountfs(devvp, mp) pribp->b_flags |= B_AGE; brelse(pribp); pribp = NULL; + rootp = NULL; + pri = NULL; + pri_sierra = NULL; mp->mnt_data = isomp; mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); @@ -391,11 +394,11 @@ iso_mountfs(devvp, mp) /* Check the Rock Ridge Extension support */ if (!(isomp->im_flags & ISOFSMNT_NORRIP)) { - if ((error = bread(isomp->im_devvp, - (isomp->root_extent + isonum_711(rootp->ext_attr_length)) << - (isomp->im_bshift - DEV_BSHIFT), - isomp->logical_block_size, NOCRED, &bp)) != 0) - goto out; + if ((error = bread(isomp->im_devvp, (isomp->root_extent + + isonum_711(((struct iso_directory_record *)isomp->root)-> + ext_attr_length)) << (isomp->im_bshift - DEV_BSHIFT), + isomp->logical_block_size, NOCRED, &bp)) != 0) + goto out; rootp = (struct iso_directory_record *)bp->b_data; @@ -412,6 +415,7 @@ iso_mountfs(devvp, mp) bp->b_flags |= B_AGE; brelse(bp); bp = NULL; + rootp = NULL; } if (isomp->im_flags & ISOFSMNT_KICONV && cd9660_iconv) { @@ -466,6 +470,7 @@ iso_mountfs(devvp, mp) if (supbp) { brelse(supbp); supbp = NULL; + sup = NULL; } return 0; From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 1 00:49:58 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8654460C; Tue, 1 Oct 2013 00:49:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 738CF2087; Tue, 1 Oct 2013 00:49:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r910nw8c056526; Tue, 1 Oct 2013 00:49:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r910nwoJ056525; Tue, 1 Oct 2013 00:49:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310010049.r910nwoJ056525@svn.freebsd.org> From: Xin LI Date: Tue, 1 Oct 2013 00:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255959 - in stable: 8/sys/dev/nfe 9/sys/dev/nfe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 00:49:58 -0000 Author: delphij Date: Tue Oct 1 00:49:57 2013 New Revision: 255959 URL: http://svnweb.freebsd.org/changeset/base/255959 Log: MFC r255648: Fix a typo when accounting for tx_broadcast statistics. Submitted by: Paul A. Patience Modified: stable/9/sys/dev/nfe/if_nfe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/nfe/if_nfe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/nfe/ (props changed) Modified: stable/9/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/9/sys/dev/nfe/if_nfe.c Mon Sep 30 21:26:03 2013 (r255958) +++ stable/9/sys/dev/nfe/if_nfe.c Tue Oct 1 00:49:57 2013 (r255959) @@ -3261,7 +3261,7 @@ nfe_stats_update(struct nfe_softc *sc) if ((sc->nfe_flags & NFE_MIB_V3) != 0) { stats->tx_unicast += NFE_READ(sc, NFE_TX_UNICAST); stats->tx_multicast += NFE_READ(sc, NFE_TX_MULTICAST); - stats->rx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); + stats->tx_broadcast += NFE_READ(sc, NFE_TX_BROADCAST); } } From owner-svn-src-stable-9@FreeBSD.ORG Tue Oct 1 08:38:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 51DD09C9; Tue, 1 Oct 2013 08:38:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E88727B4; Tue, 1 Oct 2013 08:38: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 r918cmV6006998; Tue, 1 Oct 2013 08:38:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r918cl7r006995; Tue, 1 Oct 2013 08:38:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201310010838.r918cl7r006995@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 1 Oct 2013 08:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255965 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 08:38:48 -0000 Author: hselasky Date: Tue Oct 1 08:38:47 2013 New Revision: 255965 URL: http://svnweb.freebsd.org/changeset/base/255965 Log: MFC r255768: Stability fixes for Intel LynxPoint XHCI controllers. Disable XHCI port routing if we get certain errors. Poll for command completion upon command timeouts. The XHCI error events might not generate interrupts. PR: usb/181159 Modified: stable/9/sys/dev/usb/controller/xhci.c stable/9/sys/dev/usb/controller/xhci.h stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Tue Oct 1 07:22:04 2013 (r255964) +++ stable/9/sys/dev/usb/controller/xhci.c Tue Oct 1 08:38:47 2013 (r255965) @@ -94,6 +94,8 @@ TUNABLE_INT("hw.usb.xhci.debug", &xhcide SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); +#else +#define xhciroute 0 #endif #define XHCI_INTR_ENDPT 1 @@ -179,16 +181,6 @@ xhci_dump_device(struct xhci_softc *sc, } #endif -uint32_t -xhci_get_port_route(void) -{ -#ifdef USB_DEBUG - return (0xFFFFFFFFU ^ ((uint32_t)xhciroute)); -#else - return (0xFFFFFFFFU); -#endif -} - static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { @@ -480,6 +472,11 @@ xhci_start_controller(struct xhci_softc /* catch any lost interrupts */ xhci_do_poll(&sc->sc_bus); + if (sc->sc_port_route != NULL) { + /* Route all ports to the XHCI by default */ + sc->sc_port_route(sc->sc_bus.parent, + ~xhciroute, xhciroute); + } return (0); } @@ -917,7 +914,7 @@ xhci_check_transfer(struct xhci_softc *s } } -static void +static int xhci_check_command(struct xhci_softc *sc, struct xhci_trb *trb) { if (sc->sc_cmd_addr == trb->qwTrb0) { @@ -925,16 +922,19 @@ xhci_check_command(struct xhci_softc *sc sc->sc_cmd_result[0] = trb->dwTrb2; sc->sc_cmd_result[1] = trb->dwTrb3; cv_signal(&sc->sc_cmd_cv); + return (1); /* command match */ } + return (0); } -static void +static int xhci_interrupt_poll(struct xhci_softc *sc) { struct usb_page_search buf_res; struct xhci_hw_root *phwr; uint64_t addr; uint32_t temp; + int retval = 0; uint16_t i; uint8_t event; uint8_t j; @@ -974,7 +974,7 @@ xhci_interrupt_poll(struct xhci_softc *s xhci_check_transfer(sc, &phwr->hwr_events[i]); break; case XHCI_TRB_EVENT_CMD_COMPLETE: - xhci_check_command(sc, &phwr->hwr_events[i]); + retval |= xhci_check_command(sc, &phwr->hwr_events[i]); break; default: DPRINTF("Unhandled event = %u\n", event); @@ -1011,6 +1011,8 @@ xhci_interrupt_poll(struct xhci_softc *s XWRITE4(sc, runt, XHCI_ERDP_LO(0), (uint32_t)addr); XWRITE4(sc, runt, XHCI_ERDP_HI(0), (uint32_t)(addr >> 32)); + + return (retval); } static usb_error_t @@ -1098,7 +1100,15 @@ xhci_do_command(struct xhci_softc *sc, s err = cv_timedwait(&sc->sc_cmd_cv, &sc->sc_bus.bus_mtx, USB_MS_TO_TICKS(timeout_ms)); - if (err) { + /* + * In some error cases event interrupts are not generated. + * Poll one time to see if the command has completed. + */ + if (err != 0 && xhci_interrupt_poll(sc) != 0) { + DPRINTF("Command was completed when polling\n"); + err = 0; + } + if (err != 0) { DPRINTFN(0, "Command timeout!\n"); err = USB_ERR_TIMEOUT; trb->dwTrb2 = 0; @@ -1277,6 +1287,14 @@ xhci_set_address(struct usb_device *udev (address == 0), index); if (err != 0) { + temp = le32toh(sc->sc_cmd_result[0]); + if (address == 0 && sc->sc_port_route != NULL && + XHCI_TRB_2_ERROR_GET(temp) == + XHCI_TRB_ERROR_PARAMETER) { + /* LynxPoint XHCI - ports are not switchable */ + /* Un-route all ports from the XHCI */ + sc->sc_port_route(sc->sc_bus.parent, 0, ~0); + } DPRINTF("Could not set address " "for slot %u.\n", index); if (address != 0) Modified: stable/9/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.h Tue Oct 1 07:22:04 2013 (r255964) +++ stable/9/sys/dev/usb/controller/xhci.h Tue Oct 1 08:38:47 2013 (r255965) @@ -421,6 +421,8 @@ union xhci_hub_desc { uint8_t temp[128]; }; +typedef int (xhci_port_route_t)(device_t, uint32_t, uint32_t); + struct xhci_softc { struct xhci_hw_softc sc_hw; /* base device */ @@ -429,6 +431,8 @@ struct xhci_softc { struct usb_process sc_config_proc; struct usb_bus_msg sc_config_msg[2]; + xhci_port_route_t *sc_port_route; + union xhci_hub_desc sc_hub_desc; struct cv sc_cmd_cv; @@ -491,7 +495,6 @@ struct xhci_softc { /* prototypes */ -uint32_t xhci_get_port_route(void); usb_error_t xhci_halt_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t); usb_error_t xhci_start_controller(struct xhci_softc *); Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Tue Oct 1 07:22:04 2013 (r255964) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Tue Oct 1 08:38:47 2013 (r255965) @@ -136,6 +136,25 @@ static int xhci_use_msi = 1; TUNABLE_INT("hw.usb.xhci.msi", &xhci_use_msi); static int +xhci_pci_port_route(device_t self, uint32_t set, uint32_t clear) +{ + uint32_t temp; + + temp = pci_read_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 4) | + pci_read_config(self, PCI_XHCI_INTEL_XUSB2PR, 4); + + temp |= set; + temp &= ~clear; + + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + + device_printf(self, "Port routing mask set to 0x%08x\n", temp); + + return (0); +} + +static int xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); @@ -200,6 +219,16 @@ xhci_pci_attach(device_t self) sc->sc_intr_hdl = NULL; goto error; } + /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ + switch (pci_get_devid(self)) { + case 0x1e318086: /* Panther Point */ + case 0x8c318086: /* Lynx Point */ + sc->sc_port_route = &xhci_pci_port_route; + break; + default: + break; + } + xhci_pci_take_controller(self); err = xhci_halt_controller(sc); @@ -266,7 +295,6 @@ static int xhci_pci_take_controller(device_t self) { struct xhci_softc *sc = device_get_softc(self); - uint32_t device_id = pci_get_devid(self); uint32_t cparams; uint32_t eecp; uint32_t eec; @@ -307,13 +335,5 @@ xhci_pci_take_controller(device_t self) usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } - - /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ - if (device_id == 0x1e318086 /* Panther Point */ || - device_id == 0x8c318086 /* Lynx Point */) { - uint32_t temp = xhci_get_port_route(); - pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); - pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); - } return (0); } From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 04:18:00 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E5DCABCE; Wed, 2 Oct 2013 04:18:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D351D2695; Wed, 2 Oct 2013 04:18:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r924I0mN074772; Wed, 2 Oct 2013 04:18:00 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r924I0cd074769; Wed, 2 Oct 2013 04:18:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310020418.r924I0cd074769@svn.freebsd.org> From: Glen Barber Date: Wed, 2 Oct 2013 04:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255984 - stable/9/release X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 04:18:01 -0000 Author: gjb Date: Wed Oct 2 04:18:00 2013 New Revision: 255984 URL: http://svnweb.freebsd.org/changeset/base/255984 Log: MFC r255712: Remove extra 'MAKE_FLAGS' line. Modified: stable/9/release/release.sh Directory Properties: stable/9/release/ (props changed) Modified: stable/9/release/release.sh ============================================================================== --- stable/9/release/release.sh Wed Oct 2 02:32:58 2013 (r255983) +++ stable/9/release/release.sh Wed Oct 2 04:18:00 2013 (r255984) @@ -77,7 +77,6 @@ TARGET_ARCH="${TARGET}" # ports/ checkout also forces NODOC to be set. NODOC= NOPORTS= -MAKE_FLAGS="${MAKE_FLAGS}" get_rev_branch () { # Set up the OSVERSION, BRANCH, and REVISION based on the src/ tree From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 12:35:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EC57E823; Wed, 2 Oct 2013 12:35:03 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D97FA269B; Wed, 2 Oct 2013 12:35:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92CZ36S045451; Wed, 2 Oct 2013 12:35:03 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92CZ3Ge045448; Wed, 2 Oct 2013 12:35:03 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201310021235.r92CZ3Ge045448@svn.freebsd.org> From: Philip Paeps Date: Wed, 2 Oct 2013 12:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255987 - stable/9/sys/netpfil/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 12:35:04 -0000 Author: philip Date: Wed Oct 2 12:35:03 2013 New Revision: 255987 URL: http://svnweb.freebsd.org/changeset/base/255987 Log: MFC r255928: Use the correct EtherType for logging IPv6 packets. Modified: stable/9/sys/netpfil/ipfw/ip_fw_log.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_log.c Wed Oct 2 06:00:34 2013 (r255986) +++ stable/9/sys/netpfil/ipfw/ip_fw_log.c Wed Oct 2 12:35:03 2013 (r255987) @@ -173,11 +173,18 @@ ipfw_log(struct ip_fw *f, u_int hlen, st if (args->eh) /* layer2, use orig hdr */ BPF_MTAP2(log_if, args->eh, ETHER_HDR_LEN, m); - else + else { /* Add fake header. Later we will store * more info in the header. */ - BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m); + if (ip->ip_v == 4) + BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m); + else if (ip->ip_v == 6) + BPF_MTAP2(log_if, "DDDDDDSSSSSS\x86\xdd", ETHER_HDR_LEN, m); + else + /* Obviously bogus EtherType. */ + BPF_MTAP2(log_if, "DDDDDDSSSSSS\xff\xff", ETHER_HDR_LEN, m); + } #endif /* !WITHOUT_BPF */ return; } From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 15:00:04 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EB37D176; Wed, 2 Oct 2013 15:00:04 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D81F32078; Wed, 2 Oct 2013 15:00:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92F041g093142; Wed, 2 Oct 2013 15:00:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92F04kZ093141; Wed, 2 Oct 2013 15:00:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310021500.r92F04kZ093141@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 2 Oct 2013 15:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255990 - stable/9/sys/powerpc/powerpc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 15:00:05 -0000 Author: nwhitehorn Date: Wed Oct 2 15:00:04 2013 New Revision: 255990 URL: http://svnweb.freebsd.org/changeset/base/255990 Log: MFC r255614,255639: Fix bug in busdma: if segs is a preexisting buffer, we memcpy it into the DMA map. The length of the buffer had not yet been initialized, however, so this would copy gibberish unless it happened to be right by chance. This bug mostly only affected systems with IOMMUs. Modified: stable/9/sys/powerpc/powerpc/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- stable/9/sys/powerpc/powerpc/busdma_machdep.c Wed Oct 2 14:43:17 2013 (r255989) +++ stable/9/sys/powerpc/powerpc/busdma_machdep.c Wed Oct 2 15:00:04 2013 (r255990) @@ -843,16 +843,19 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dma_segment_t *segs, int nsegs, int error) { + map->nsegs = nsegs; if (segs != NULL) memcpy(map->segments, segs, map->nsegs*sizeof(segs[0])); - else - segs = map->segments; - map->nsegs = nsegs; if (dmat->iommu != NULL) IOMMU_MAP(dmat->iommu, map->segments, &map->nsegs, dmat->lowaddr, dmat->highaddr, dmat->alignment, dmat->boundary, dmat->iommu_cookie); + if (segs != NULL) + memcpy(segs, map->segments, map->nsegs*sizeof(segs[0])); + else + segs = map->segments; + return (segs); } From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 16:32:09 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 669FC6D1; Wed, 2 Oct 2013 16:32:09 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 520692672; Wed, 2 Oct 2013 16:32:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92GW9BS085343; Wed, 2 Oct 2013 16:32:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92GW8o1085331; Wed, 2 Oct 2013 16:32:08 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201310021632.r92GW8o1085331@svn.freebsd.org> From: Devin Teske Date: Wed, 2 Oct 2013 16:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255991 - in stable/9/usr.sbin/bsdconfig: examples share/media X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 16:32:09 -0000 Author: dteske Date: Wed Oct 2 16:32:07 2013 New Revision: 255991 URL: http://svnweb.freebsd.org/changeset/base/255991 Log: MFC revisions 255908, 255925, and 255925: SVN r255908: Fix a bug in HTTP checking/fetching. Add Main Site to HTTP menu. Add new example script browse_packages_http.sh and move existing example script browse_packages.sh -> browse_packages_ftp.sh SVN r255925: Remove the is (Iceland) mirror per mail from the admins. SVN r255925: Remove ftp5.se.f.o, as per request to -hubs@ Added: stable/9/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh - copied unchanged from r255818, head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh stable/9/usr.sbin/bsdconfig/examples/browse_packages_http.sh - copied unchanged from r255818, head/usr.sbin/bsdconfig/examples/browse_packages_http.sh Deleted: stable/9/usr.sbin/bsdconfig/examples/browse_packages.sh Modified: stable/9/usr.sbin/bsdconfig/examples/Makefile stable/9/usr.sbin/bsdconfig/share/media/ftp.subr stable/9/usr.sbin/bsdconfig/share/media/http.subr Directory Properties: stable/9/usr.sbin/bsdconfig/ (props changed) Modified: stable/9/usr.sbin/bsdconfig/examples/Makefile ============================================================================== --- stable/9/usr.sbin/bsdconfig/examples/Makefile Wed Oct 2 15:00:04 2013 (r255990) +++ stable/9/usr.sbin/bsdconfig/examples/Makefile Wed Oct 2 16:32:07 2013 (r255991) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/examples/bsdconfig -FILES= browse_packages.sh bsdconfigrc +FILES= browse_packages_ftp.sh browse_packages_http.sh bsdconfigrc beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Copied: stable/9/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh (from r255818, head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Wed Oct 2 16:32:07 2013 (r255991, copy of r255818, head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh) @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample downloads the package INDEX file from FTP to /tmp (if it doesn't +# already exist) and then displays the package configuration/management screen +# using the local INDEX file (results in faster browsing of packages from-start +# since the INDEX can be loaded from local media). +# +# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# +. /usr/share/bsdconfig/script.subr +nonInteractive=1 +TMPDIR=/tmp +if [ ! -e "$TMPDIR/packages/INDEX" ]; then + [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 + _ftpPath=ftp://ftp.freebsd.org + # For older releases, use ftp://ftp-archive.freebsd.org + mediaSetFTP + mediaOpen + f_show_info "Downloading packages/INDEX from\n %s" "$_ftpPath" + f_device_get media packages/INDEX > $TMPDIR/packages/INDEX +fi +_directoryPath=$TMPDIR +mediaSetDirectory +configPackages Copied: stable/9/usr.sbin/bsdconfig/examples/browse_packages_http.sh (from r255818, head/usr.sbin/bsdconfig/examples/browse_packages_http.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/examples/browse_packages_http.sh Wed Oct 2 16:32:07 2013 (r255991, copy of r255818, head/usr.sbin/bsdconfig/examples/browse_packages_http.sh) @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample downloads the package INDEX file from HTTP to /tmp (if it doesn't +# already exist) and then displays the package configuration/management screen +# using the local INDEX file (results in faster browsing of packages from-start +# since the INDEX can be loaded from local media). +# +# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# +. /usr/share/bsdconfig/script.subr +nonInteractive=1 +TMPDIR=/tmp +if [ ! -e "$TMPDIR/packages/INDEX" ]; then + [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 + _httpPath=http://ftp.freebsd.org + # For older releases, use http://ftp-archive.freebsd.org + mediaSetHTTP + mediaOpen + f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath" + f_device_get media packages/INDEX > $TMPDIR/packages/INDEX +fi +_directoryPath=$TMPDIR +mediaSetDirectory +configPackages Modified: stable/9/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- stable/9/usr.sbin/bsdconfig/share/media/ftp.subr Wed Oct 2 15:00:04 2013 (r255990) +++ stable/9/usr.sbin/bsdconfig/share/media/ftp.subr Wed Oct 2 16:32:07 2013 (r255991) @@ -125,7 +125,6 @@ f_dialog_menu_media_ftp() ' $msg_germany #8' 'ftp8.de.freebsd.org' '$msg_greece' 'ftp.gr.freebsd.org' ' $msg_greece #2' 'ftp2.gr.freebsd.org' - '$msg_iceland' 'ftp.is.freebsd.org' '$msg_ireland' 'ftp3.ie.freebsd.org' '$msg_israel' 'ftp.il.freebsd.org' '$msg_italy' 'ftp.it.freebsd.org' @@ -165,7 +164,6 @@ f_dialog_menu_media_ftp() ' $msg_sweden #2' 'ftp2.se.freebsd.org' ' $msg_sweden #3' 'ftp3.se.freebsd.org' ' $msg_sweden #4' 'ftp4.se.freebsd.org' - ' $msg_sweden #5' 'ftp5.se.freebsd.org' ' $msg_sweden #6' 'ftp6.se.freebsd.org' '$msg_switzerland' 'ftp.ch.freebsd.org' '$msg_taiwan' 'ftp.tw.freebsd.org' Modified: stable/9/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- stable/9/usr.sbin/bsdconfig/share/media/http.subr Wed Oct 2 15:00:04 2013 (r255990) +++ stable/9/usr.sbin/bsdconfig/share/media/http.subr Wed Oct 2 16:32:07 2013 (r255991) @@ -77,7 +77,8 @@ f_dialog_menu_media_http() f_dialog_title_restore local prompt="$msg_please_select_the_site_closest_to_you_or_other" local menu_list=" - 'URL' '$msg_specify_some_other_http_site' + '$msg_main_site' 'ftp.freebsd.org' + 'URL' '$msg_specify_some_other_http_site' " # END-QUOTE local hline="$msg_select_a_site_thats_close" @@ -390,8 +391,12 @@ f_http_check_access() f_show_info "$msg_checking_access_to" "$http_path" local rx + case "$http_path" in + http://*|/*) : valid request ;; + *) http_path="/$http_path" # full URI requests only + esac if ! rx=$( - printf "GET /%s/ HTTP/1.0\r\n\r\n" "${http_path%/}" | + printf "GET %s/ HTTP/1.0\r\n\r\n" "${http_path%/}" | nc -n "$host" "$http_port" ); then f_show_msg "$msg_couldnt_connect_to_server http://%s:%s/" \ @@ -581,8 +586,12 @@ f_media_get_http() local http_path f_getvar $VAR_HTTP_PATH%/ http_path - local url="/$http_path/$file" rx + case "$http_path" in + http://*|/*) : valid request ;; + *) http_path="/$http_path" # full URI requests only + esac + local url="$http_path/$file" rx f_dprintf "sending http request for: %s" "$url" printf "GET %s HTTP/1.0\r\n\r\n" "$url" | nc -n "$host" "$http_port" | ( From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 18:45:40 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 144009CC; Wed, 2 Oct 2013 18:45:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F350E2034; Wed, 2 Oct 2013 18:45:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92Ijd9O014001; Wed, 2 Oct 2013 18:45:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92Ijcvu013978; Wed, 2 Oct 2013 18:45:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310021845.r92Ijcvu013978@svn.freebsd.org> From: John Baldwin Date: Wed, 2 Oct 2013 18:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256001 - in stable/9: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 18:45:40 -0000 Author: jhb Date: Wed Oct 2 18:45:37 2013 New Revision: 256001 URL: http://svnweb.freebsd.org/changeset/base/256001 Log: MFC 236768,252209,253047: Several improvements to rmlock(9). Many of these are based on patches provided by Isilon. - Add an rm_assert() supporting various lock assertions similar to other locking primitives. Because rmlocks track readers the assertions are always fully accurate unlike rw_assert() and sx_assert(). - Flesh out the lock class methods for rmlocks to support sleeping via condvars and rm_sleep() (but only while holding write locks), rmlock details in 'show lock' in DDB, and the lc_owner method used by dtrace. - Add an internal destroyed cookie so that API functions can assert that an rmlock is not destroyed. - Make use of rm_assert() to add various assertions to the API (e.g. to assert locks are held when an unlock routine is called). - Give RM_SLEEPABLE locks their own lock class and always use the rmlock's own lock_object with WITNESS. - Various updates to the manpage. Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/rmlock.9 stable/9/sys/kern/kern_cpuset.c stable/9/sys/kern/kern_rmlock.c stable/9/sys/kern/subr_lock.c stable/9/sys/sys/_rmlock.h stable/9/sys/sys/cpuset.h stable/9/sys/sys/lock.h stable/9/sys/sys/rmlock.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/share/man/man9/Makefile Wed Oct 2 18:45:37 2013 (r256001) @@ -1058,12 +1058,15 @@ MLINKS+=rman.9 rman_activate_resource.9 rman.9 rman_set_bustag.9 \ rman.9 rman_set_rid.9 \ rman.9 rman_set_virtual.9 -MLINKS+=rmlock.9 rm_destroy.9 \ +MLINKS+=rmlock.9 rm_assert.9 \ + rmlock.9 rm_destroy.9 \ rmlock.9 rm_init.9 \ + rmlock.9 rm_init_flags.9 \ rmlock.9 rm_rlock.9 \ - rmlock.9 rm_try_rlock.9 \ rmlock.9 rm_runlock.9 \ + rmlock.9 rm_sleep.9 \ rmlock.9 RM_SYSINIT.9 \ + rmlock.9 rm_try_rlock.9 \ rmlock.9 rm_wlock.9 \ rmlock.9 rm_wowned.9 \ rmlock.9 rm_wunlock.9 Modified: stable/9/share/man/man9/rmlock.9 ============================================================================== --- stable/9/share/man/man9/rmlock.9 Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/share/man/man9/rmlock.9 Wed Oct 2 18:45:37 2013 (r256001) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .\" Based on rwlock.9 man page -.Dd November 10, 2007 +.Dd June 25, 2013 .Dt RMLOCK 9 .Os .Sh NAME @@ -40,8 +40,10 @@ .Nm rm_runlock , .Nm rm_wunlock , .Nm rm_wowned , +.Nm rm_sleep , +.Nm rm_assert , .Nm RM_SYSINIT -.Nd kernel reader/writer lock optimized for mostly read access patterns +.Nd kernel reader/writer lock optimized for read-mostly access patterns .Sh SYNOPSIS .In sys/param.h .In sys/lock.h @@ -64,10 +66,17 @@ .Fn rm_wunlock "struct rmlock *rm" .Ft int .Fn rm_wowned "struct rmlock *rm" +.Ft int +.Fn rm_sleep "void *wchan" "struct rmlock *rm" "int priority" "const char *wmesg" "int timo" +.Pp +.Cd "options INVARIANTS" +.Cd "options INVARIANT_SUPPORT" +.Ft void +.Fn rm_assert "struct rmlock *rm" "int what" .In sys/kernel.h .Fn RM_SYSINIT "name" "struct rmlock *rm" "const char *desc" "int opts" .Sh DESCRIPTION -Mostly reader locks allow shared access to protected data by multiple threads, +Read-mostly locks allow shared access to protected data by multiple threads, or exclusive access by a single thread. The threads with shared access are known as .Em readers @@ -76,83 +85,82 @@ A thread with exclusive access is known .Em writer since it can modify protected data. .Pp -Read mostly locks are designed to be efficient for locks almost exclusively +Read-mostly locks are designed to be efficient for locks almost exclusively used as reader locks and as such should be used for protecting data that rarely changes. -Acquiring an exclusive lock after the lock had been locked for shared access +Acquiring an exclusive lock after the lock has been locked for shared access is an expensive operation. .Pp -Although reader/writer locks look very similar to -.Xr sx 9 -locks, their usage pattern is different. -Reader/writer locks can be treated as mutexes (see -.Xr mutex 9 ) -with shared/exclusive semantics unless initialized with -.Dv RM_SLEEPABLE . +Normal read-mostly locks are similar to +.Xr rwlock 9 +locks and follow the same lock ordering rules as +.Xr rwlock 9 +locks. +Read-mostly locks have full priority propagation like mutexes. Unlike -.Xr sx 9 , -an -.Nm -can be locked while holding a non-spin mutex, and an -.Nm -cannot be held while sleeping, again unless initialized with -.Dv RM_SLEEPABLE . -The -.Nm -locks have full priority propagation like mutexes. -The +.Xr rwlock 9 , +read-mostly locks propagate priority to both readers and writers. +This is implemented via the .Va rm_priotracker -structure argument supplied in +structure argument supplied to .Fn rm_rlock and -.Fn rm_runlock -is used to keep track of the read owner(s). -Another important property is that shared holders of -.Nm -can recurse if the lock has been initialized with the -.Dv LO_RECURSABLE -option, however exclusive locks are not allowed to recurse. +.Fn rm_runlock . +Readers can recurse if the lock is initialized with the +.Dv RM_RECURSE +option; +however, writers are never allowed to recurse. +.Pp +Sleepable read-mostly locks are created by passing +.Dv RM_SLEEPABLE +to +.Fn rm_init_flags . +Unlike normal read-mostly locks, +sleepable read-mostly locks follow the same lock ordering rules as +.Xr sx 9 +locks. +Sleepable read-mostly locks do not propagate priority to writers, +but they do propagate priority to readers. +Writers are permitted to sleep while holding a read-mostly lock, +but readers are not. +Unlike other sleepable locks such as +.Xr sx 9 +locks, +readers must use try operations on other sleepable locks to avoid sleeping. .Ss Macros and Functions .Bl -tag -width indent .It Fn rm_init "struct rmlock *rm" "const char *name" -Initialize structure located at -.Fa rm -as mostly reader lock, described by -.Fa name . -The name description is used solely for debugging purposes. +Initialize the read-mostly lock +.Fa rm . +The +.Fa name +description is used solely for debugging purposes. This function must be called before any other operations on the lock. .It Fn rm_init_flags "struct rmlock *rm" "const char *name" "int opts" -Initialize the rm lock just like the -.Fn rm_init -function, but specifying a set of optional flags to alter the -behaviour of -.Fa rm , -through the +Similar to +.Fn rm_init , +initialize the read-mostly lock +.Fa rm +with a set of optional flags. +The .Fa opts -argument. -It contains one or more of the following flags: +arguments contains one or more of the following flags: .Bl -tag -width ".Dv RM_NOWITNESS" .It Dv RM_NOWITNESS Instruct .Xr witness 4 to ignore this lock. .It Dv RM_RECURSE -Allow threads to recursively acquire exclusive locks for +Allow threads to recursively acquire shared locks for .Fa rm . .It Dv RM_SLEEPABLE -Allow writers to sleep while holding the lock. -Readers must not sleep while holding the lock and can avoid to sleep on -taking the lock by using -.Fn rm_try_rlock -instead of -.Fn rm_rlock . +Create a sleepable read-mostly lock. .El .It Fn rm_rlock "struct rmlock *rm" "struct rm_priotracker* tracker" Lock .Fa rm -as a reader. -Using +as a reader using .Fa tracker to track read owners of a lock for priority propagation. This data structure is only used internally by @@ -161,28 +169,32 @@ and must persist until .Fn rm_runlock has been called. This data structure can be allocated on the stack since -rmlocks cannot be held while sleeping. +readers cannot sleep. If any thread holds this lock exclusively, the current thread blocks, and its priority is propagated to the exclusive holder. If the lock was initialized with the -.Dv LO_RECURSABLE +.Dv RM_RECURSE option the .Fn rm_rlock -function can be called when the thread has already acquired reader +function can be called when the current thread has already acquired reader access on .Fa rm . -This is called -.Dq "recursing on a lock" . .It Fn rm_try_rlock "struct rmlock *rm" "struct rm_priotracker* tracker" Try to lock .Fa rm as a reader. .Fn rm_try_rlock will return 0 if the lock cannot be acquired immediately; -otherwise the lock will be acquired and a non-zero value will be returned. +otherwise, +the lock will be acquired and a non-zero value will be returned. Note that .Fn rm_try_rlock may fail even while the lock is not currently held by a writer. +If the lock was initialized with the +.Dv RM_RECURSE +option, +.Fn rm_try_rlock +will succeed if the current thread has already acquired reader access. .It Fn rm_wlock "struct rmlock *rm" Lock .Fa rm @@ -212,12 +224,63 @@ lock must be unlocked. This function returns a non-zero value if the current thread owns an exclusive lock on .Fa rm . +.It Fn rm_sleep "void *wchan" "struct rmlock *rm" "int priority" "const char *wmesg" "int timo" +This function atomically releases +.Fa rm +while waiting for an event. +The +.Fa rm +lock must be exclusively locked. +For more details on the parameters to this function, +see +.Xr sleep 9 . +.It Fn rm_assert "struct rmlock *rm" "int what" +This function asserts that the +.Fa rm +lock is in the state specified by +.Fa what . +If the assertions are not true and the kernel is compiled with +.Cd "options INVARIANTS" +and +.Cd "options INVARIANT_SUPPORT" , +the kernel will panic. +Currently the following base assertions are supported: +.Bl -tag -width ".Dv RA_UNLOCKED" +.It Dv RA_LOCKED +Assert that current thread holds either a shared or exclusive lock +of +.Fa rm . +.It Dv RA_RLOCKED +Assert that current thread holds a shared lock of +.Fa rm . +.It Dv RA_WLOCKED +Assert that current thread holds an exclusive lock of +.Fa rm . +.It Dv RA_UNLOCKED +Assert that current thread holds neither a shared nor exclusive lock of +.Fa rm . +.El +.Pp +In addition, one of the following optional flags may be specified with +.Dv RA_LOCKED , +.Dv RA_RLOCKED , +or +.Dv RA_WLOCKED : +.Bl -tag -width ".Dv RA_NOTRECURSED" +.It Dv RA_RECURSED +Assert that the current thread holds a recursive lock of +.Fa rm . +.It Dv RA_NOTRECURSED +Assert that the current thread does not hold a recursive lock of +.Fa rm . +.El .El .Sh SEE ALSO .Xr locking 9 , .Xr mutex 9 , .Xr panic 9 , .Xr rwlock 9 , +.Xr sleep 9 , .Xr sema 9 , .Xr sx 9 .Sh HISTORY @@ -249,8 +312,3 @@ implementation uses a single per CPU lis rmlocks in the system. If rmlocks become popular, hashing to multiple per CPU queues may be needed to speed up the writer lock process. -.Pp -The -.Nm -can currently not be used as a lock argument for condition variable -wait functions. Modified: stable/9/sys/kern/kern_cpuset.c ============================================================================== --- stable/9/sys/kern/kern_cpuset.c Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/kern/kern_cpuset.c Wed Oct 2 18:45:37 2013 (r256001) @@ -1149,25 +1149,34 @@ out: } #ifdef DDB +void +ddb_display_cpuset(const cpuset_t *set) +{ + int cpu, once; + + for (once = 0, cpu = 0; cpu < CPU_SETSIZE; cpu++) { + if (CPU_ISSET(cpu, set)) { + if (once == 0) { + db_printf("%d", cpu); + once = 1; + } else + db_printf(",%d", cpu); + } + } + if (once == 0) + db_printf(""); +} + DB_SHOW_COMMAND(cpusets, db_show_cpusets) { struct cpuset *set; - int cpu, once; LIST_FOREACH(set, &cpuset_ids, cs_link) { db_printf("set=%p id=%-6u ref=%-6d flags=0x%04x parent id=%d\n", set, set->cs_id, set->cs_ref, set->cs_flags, (set->cs_parent != NULL) ? set->cs_parent->cs_id : 0); db_printf(" mask="); - for (once = 0, cpu = 0; cpu < CPU_SETSIZE; cpu++) { - if (CPU_ISSET(cpu, &set->cs_mask)) { - if (once == 0) { - db_printf("%d", cpu); - once = 1; - } else - db_printf(",%d", cpu); - } - } + ddb_display_cpuset(&set->cs_mask); db_printf("\n"); if (db_pager_quit) break; Modified: stable/9/sys/kern/kern_rmlock.c ============================================================================== --- stable/9/sys/kern/kern_rmlock.c Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/kern/kern_rmlock.c Wed Oct 2 18:45:37 2013 (r256001) @@ -57,16 +57,26 @@ __FBSDID("$FreeBSD$"); #include #endif +/* + * A cookie to mark destroyed rmlocks. This is stored in the head of + * rm_activeReaders. + */ +#define RM_DESTROYED ((void *)0xdead) + +#define rm_destroyed(rm) \ + (LIST_FIRST(&(rm)->rm_activeReaders) == RM_DESTROYED) + #define RMPF_ONQUEUE 1 #define RMPF_SIGNAL 2 -/* - * To support usage of rmlock in CVs and msleep yet another list for the - * priority tracker would be needed. Using this lock for cv and msleep also - * does not seem very useful - */ +#ifndef INVARIANTS +#define _rm_assert(c, what, file, line) +#endif static void assert_rm(struct lock_object *lock, int what); +#ifdef DDB +static void db_show_rm(struct lock_object *lock); +#endif static void lock_rm(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS static int owner_rm(struct lock_object *lock, struct thread **owner); @@ -77,10 +87,22 @@ struct lock_class lock_class_rm = { .lc_name = "rm", .lc_flags = LC_SLEEPLOCK | LC_RECURSABLE, .lc_assert = assert_rm, -#if 0 #ifdef DDB - .lc_ddb_show = db_show_rwlock, + .lc_ddb_show = db_show_rm, +#endif + .lc_lock = lock_rm, + .lc_unlock = unlock_rm, +#ifdef KDTRACE_HOOKS + .lc_owner = owner_rm, #endif +}; + +struct lock_class lock_class_rm_sleepable = { + .lc_name = "sleepable rm", + .lc_flags = LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE, + .lc_assert = assert_rm, +#ifdef DDB + .lc_ddb_show = db_show_rm, #endif .lc_lock = lock_rm, .lc_unlock = unlock_rm, @@ -93,29 +115,49 @@ static void assert_rm(struct lock_object *lock, int what) { - panic("assert_rm called"); + rm_assert((struct rmlock *)lock, what); } +/* + * These do not support read locks because it would be hard to make + * the tracker work correctly with the current lock_class API as you + * would need to have the tracker pointer available when calling + * rm_rlock() in lock_rm(). + */ static void lock_rm(struct lock_object *lock, int how) { + struct rmlock *rm; - panic("lock_rm called"); + rm = (struct rmlock *)lock; + if (how) + rm_wlock(rm); +#ifdef INVARIANTS + else + panic("lock_rm called in read mode"); +#endif } static int unlock_rm(struct lock_object *lock) { + struct rmlock *rm; - panic("unlock_rm called"); + rm = (struct rmlock *)lock; + rm_wunlock(rm); + return (1); } #ifdef KDTRACE_HOOKS static int owner_rm(struct lock_object *lock, struct thread **owner) { + struct rmlock *rm; + struct lock_class *lc; - panic("owner_rm called"); + rm = (struct rmlock *)lock; + lc = LOCK_CLASS(&rm->rm_wlock_object); + return (lc->lc_owner(&rm->rm_wlock_object, owner)); } #endif @@ -146,6 +188,28 @@ rm_tracker_add(struct pcpu *pc, struct r pc->pc_rm_queue.rmq_next = &tracker->rmp_cpuQueue; } +/* + * Return a count of the number of trackers the thread 'td' already + * has on this CPU for the lock 'rm'. + */ +static int +rm_trackers_present(const struct pcpu *pc, const struct rmlock *rm, + const struct thread *td) +{ + struct rm_queue *queue; + struct rm_priotracker *tracker; + int count; + + count = 0; + for (queue = pc->pc_rm_queue.rmq_next; queue != &pc->pc_rm_queue; + queue = queue->rmq_next) { + tracker = (struct rm_priotracker *)queue; + if ((tracker->rmp_rmlock == rm) && (tracker->rmp_thread == td)) + count++; + } + return (count); +} + static void inline rm_tracker_remove(struct pcpu *pc, struct rm_priotracker *tracker) { @@ -183,11 +247,10 @@ rm_cleanIPI(void *arg) } } -CTASSERT((RM_SLEEPABLE & LO_CLASSFLAGS) == RM_SLEEPABLE); - void rm_init_flags(struct rmlock *rm, const char *name, int opts) { + struct lock_class *lc; int liflags; liflags = 0; @@ -198,11 +261,14 @@ rm_init_flags(struct rmlock *rm, const c rm->rm_writecpus = all_cpus; LIST_INIT(&rm->rm_activeReaders); if (opts & RM_SLEEPABLE) { - liflags |= RM_SLEEPABLE; - sx_init_flags(&rm->rm_lock_sx, "rmlock_sx", SX_RECURSE); - } else + liflags |= LO_SLEEPABLE; + lc = &lock_class_rm_sleepable; + sx_init_flags(&rm->rm_lock_sx, "rmlock_sx", SX_NOWITNESS); + } else { + lc = &lock_class_rm; mtx_init(&rm->rm_lock_mtx, name, "rmlock_mtx", MTX_NOWITNESS); - lock_init(&rm->lock_object, &lock_class_rm, name, NULL, liflags); + } + lock_init(&rm->lock_object, lc, name, NULL, liflags); } void @@ -216,7 +282,9 @@ void rm_destroy(struct rmlock *rm) { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + rm_assert(rm, RA_UNLOCKED); + LIST_FIRST(&rm->rm_activeReaders) = RM_DESTROYED; + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_destroy(&rm->rm_lock_sx); else mtx_destroy(&rm->rm_lock_mtx); @@ -227,7 +295,7 @@ int rm_wowned(struct rmlock *rm) { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) return (sx_xlocked(&rm->rm_lock_sx)); else return (mtx_owned(&rm->rm_lock_mtx)); @@ -253,8 +321,6 @@ static int _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock) { struct pcpu *pc; - struct rm_queue *queue; - struct rm_priotracker *atracker; critical_enter(); pc = pcpu_find(curcpu); @@ -285,20 +351,15 @@ _rm_rlock_hard(struct rmlock *rm, struct * Just grant the lock if this thread already has a tracker * for this lock on the per-cpu queue. */ - for (queue = pc->pc_rm_queue.rmq_next; - queue != &pc->pc_rm_queue; queue = queue->rmq_next) { - atracker = (struct rm_priotracker *)queue; - if ((atracker->rmp_rmlock == rm) && - (atracker->rmp_thread == tracker->rmp_thread)) { - mtx_lock_spin(&rm_spinlock); - LIST_INSERT_HEAD(&rm->rm_activeReaders, - tracker, rmp_qentry); - tracker->rmp_flags = RMPF_ONQUEUE; - mtx_unlock_spin(&rm_spinlock); - rm_tracker_add(pc, tracker); - critical_exit(); - return (1); - } + if (rm_trackers_present(pc, rm, curthread) != 0) { + mtx_lock_spin(&rm_spinlock); + LIST_INSERT_HEAD(&rm->rm_activeReaders, tracker, + rmp_qentry); + tracker->rmp_flags = RMPF_ONQUEUE; + mtx_unlock_spin(&rm_spinlock); + rm_tracker_add(pc, tracker); + critical_exit(); + return (1); } } @@ -306,7 +367,7 @@ _rm_rlock_hard(struct rmlock *rm, struct critical_exit(); if (trylock) { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) { + if (rm->lock_object.lo_flags & LO_SLEEPABLE) { if (!sx_try_xlock(&rm->rm_lock_sx)) return (0); } else { @@ -314,7 +375,7 @@ _rm_rlock_hard(struct rmlock *rm, struct return (0); } } else { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_xlock(&rm->rm_lock_sx); else mtx_lock(&rm->rm_lock_mtx); @@ -327,7 +388,7 @@ _rm_rlock_hard(struct rmlock *rm, struct sched_pin(); critical_exit(); - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_xunlock(&rm->rm_lock_sx); else mtx_unlock(&rm->rm_lock_mtx); @@ -438,7 +499,7 @@ _rm_wlock(struct rmlock *rm) if (SCHEDULER_STOPPED()) return; - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_xlock(&rm->rm_lock_sx); else mtx_lock(&rm->rm_lock_mtx); @@ -481,7 +542,7 @@ void _rm_wunlock(struct rmlock *rm) { - if (rm->lock_object.lo_flags & RM_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) sx_xunlock(&rm->rm_lock_sx); else mtx_unlock(&rm->rm_lock_mtx); @@ -489,7 +550,8 @@ _rm_wunlock(struct rmlock *rm) #ifdef LOCK_DEBUG -void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) +void +_rm_wlock_debug(struct rmlock *rm, const char *file, int line) { if (SCHEDULER_STOPPED()) @@ -498,6 +560,10 @@ void _rm_wlock_debug(struct rmlock *rm, KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), ("rm_wlock() by idle thread %p on rmlock %s @ %s:%d", curthread, rm->lock_object.lo_name, file, line)); + KASSERT(!rm_destroyed(rm), + ("rm_wlock() of destroyed rmlock @ %s:%d", file, line)); + _rm_assert(rm, RA_UNLOCKED, file, line); + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); @@ -505,11 +571,7 @@ void _rm_wlock_debug(struct rmlock *rm, LOCK_LOG_LOCK("RMWLOCK", &rm->lock_object, 0, 0, file, line); - if (rm->lock_object.lo_flags & RM_SLEEPABLE) - WITNESS_LOCK(&rm->rm_lock_sx.lock_object, LOP_EXCLUSIVE, - file, line); - else - WITNESS_LOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); + WITNESS_LOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); curthread->td_locks++; @@ -522,14 +584,13 @@ _rm_wunlock_debug(struct rmlock *rm, con if (SCHEDULER_STOPPED()) return; - curthread->td_locks--; - if (rm->lock_object.lo_flags & RM_SLEEPABLE) - WITNESS_UNLOCK(&rm->rm_lock_sx.lock_object, LOP_EXCLUSIVE, - file, line); - else - WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); + KASSERT(!rm_destroyed(rm), + ("rm_wunlock() of destroyed rmlock @ %s:%d", file, line)); + _rm_assert(rm, RA_WLOCKED, file, line); + WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("RMWUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_wunlock(rm); + curthread->td_locks--; } int @@ -540,23 +601,43 @@ _rm_rlock_debug(struct rmlock *rm, struc if (SCHEDULER_STOPPED()) return (1); +#ifdef INVARIANTS + if (!(rm->lock_object.lo_flags & LO_RECURSABLE) && !trylock) { + critical_enter(); + KASSERT(rm_trackers_present(pcpu_find(curcpu), rm, + curthread) == 0, + ("rm_rlock: recursed on non-recursive rmlock %s @ %s:%d\n", + rm->lock_object.lo_name, file, line)); + critical_exit(); + } +#endif KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), ("rm_rlock() by idle thread %p on rmlock %s @ %s:%d", curthread, rm->lock_object.lo_name, file, line)); - if (!trylock && (rm->lock_object.lo_flags & RM_SLEEPABLE)) - WITNESS_CHECKORDER(&rm->rm_lock_sx.lock_object, LOP_NEWORDER, - file, line, NULL); - WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, NULL); + KASSERT(!rm_destroyed(rm), + ("rm_rlock() of destroyed rmlock @ %s:%d", file, line)); + if (!trylock) { + KASSERT(!rm_wowned(rm), + ("rm_rlock: wlock already held for %s @ %s:%d", + rm->lock_object.lo_name, file, line)); + WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER, file, line, + NULL); + } if (_rm_rlock(rm, tracker, trylock)) { - LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, line); - + if (trylock) + LOCK_LOG_TRY("RMRLOCK", &rm->lock_object, 0, 1, file, + line); + else + LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, + line); WITNESS_LOCK(&rm->lock_object, 0, file, line); curthread->td_locks++; return (1); - } + } else if (trylock) + LOCK_LOG_TRY("RMRLOCK", &rm->lock_object, 0, 0, file, line); return (0); } @@ -569,10 +650,13 @@ _rm_runlock_debug(struct rmlock *rm, str if (SCHEDULER_STOPPED()) return; - curthread->td_locks--; + KASSERT(!rm_destroyed(rm), + ("rm_runlock() of destroyed rmlock @ %s:%d", file, line)); + _rm_assert(rm, RA_RLOCKED, file, line); WITNESS_UNLOCK(&rm->lock_object, 0, file, line); LOCK_LOG_LOCK("RMRUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_runlock(rm, tracker); + curthread->td_locks--; } #else @@ -612,3 +696,130 @@ _rm_runlock_debug(struct rmlock *rm, str } #endif + +#ifdef INVARIANT_SUPPORT +#ifndef INVARIANTS +#undef _rm_assert +#endif + +/* + * Note that this does not need to use witness_assert() for read lock + * assertions since an exact count of read locks held by this thread + * is computable. + */ +void +_rm_assert(struct rmlock *rm, int what, const char *file, int line) +{ + int count; + + if (panicstr != NULL) + return; + switch (what) { + case RA_LOCKED: + case RA_LOCKED | RA_RECURSED: + case RA_LOCKED | RA_NOTRECURSED: + case RA_RLOCKED: + case RA_RLOCKED | RA_RECURSED: + case RA_RLOCKED | RA_NOTRECURSED: + /* + * Handle the write-locked case. Unlike other + * primitives, writers can never recurse. + */ + if (rm_wowned(rm)) { + if (what & RA_RLOCKED) + panic("Lock %s exclusively locked @ %s:%d\n", + rm->lock_object.lo_name, file, line); + if (what & RA_RECURSED) + panic("Lock %s not recursed @ %s:%d\n", + rm->lock_object.lo_name, file, line); + break; + } + + critical_enter(); + count = rm_trackers_present(pcpu_find(curcpu), rm, curthread); + critical_exit(); + + if (count == 0) + panic("Lock %s not %slocked @ %s:%d\n", + rm->lock_object.lo_name, (what & RA_RLOCKED) ? + "read " : "", file, line); + if (count > 1) { + if (what & RA_NOTRECURSED) + panic("Lock %s recursed @ %s:%d\n", + rm->lock_object.lo_name, file, line); + } else if (what & RA_RECURSED) + panic("Lock %s not recursed @ %s:%d\n", + rm->lock_object.lo_name, file, line); + break; + case RA_WLOCKED: + if (!rm_wowned(rm)) + panic("Lock %s not exclusively locked @ %s:%d\n", + rm->lock_object.lo_name, file, line); + break; + case RA_UNLOCKED: + if (rm_wowned(rm)) + panic("Lock %s exclusively locked @ %s:%d\n", + rm->lock_object.lo_name, file, line); + + critical_enter(); + count = rm_trackers_present(pcpu_find(curcpu), rm, curthread); + critical_exit(); + + if (count != 0) + panic("Lock %s read locked @ %s:%d\n", + rm->lock_object.lo_name, file, line); + break; + default: + panic("Unknown rm lock assertion: %d @ %s:%d", what, file, + line); + } +} +#endif /* INVARIANT_SUPPORT */ + +#ifdef DDB +static void +print_tracker(struct rm_priotracker *tr) +{ + struct thread *td; + + td = tr->rmp_thread; + db_printf(" thread %p (tid %d, pid %d, \"%s\") {", td, td->td_tid, + td->td_proc->p_pid, td->td_name); + if (tr->rmp_flags & RMPF_ONQUEUE) { + db_printf("ONQUEUE"); + if (tr->rmp_flags & RMPF_SIGNAL) + db_printf(",SIGNAL"); + } else + db_printf("0"); + db_printf("}\n"); +} + +static void +db_show_rm(struct lock_object *lock) +{ + struct rm_priotracker *tr; + struct rm_queue *queue; + struct rmlock *rm; + struct lock_class *lc; + struct pcpu *pc; + + rm = (struct rmlock *)lock; + db_printf(" writecpus: "); + ddb_display_cpuset(__DEQUALIFY(const cpuset_t *, &rm->rm_writecpus)); + db_printf("\n"); + db_printf(" per-CPU readers:\n"); + STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) + for (queue = pc->pc_rm_queue.rmq_next; + queue != &pc->pc_rm_queue; queue = queue->rmq_next) { + tr = (struct rm_priotracker *)queue; + if (tr->rmp_rmlock == rm) + print_tracker(tr); + } + db_printf(" active readers:\n"); + LIST_FOREACH(tr, &rm->rm_activeReaders, rmp_qentry) + print_tracker(tr); + lc = LOCK_CLASS(&rm->rm_wlock_object); + db_printf("Backing write-lock (%s):\n", lc->lc_name); + lc->lc_ddb_show(&rm->rm_wlock_object); +} +#endif Modified: stable/9/sys/kern/subr_lock.c ============================================================================== --- stable/9/sys/kern/subr_lock.c Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/kern/subr_lock.c Wed Oct 2 18:45:37 2013 (r256001) @@ -66,6 +66,7 @@ struct lock_class *lock_classes[LOCK_CLA &lock_class_mtx_sleep, &lock_class_sx, &lock_class_rm, + &lock_class_rm_sleepable, &lock_class_rw, &lock_class_lockmgr, }; Modified: stable/9/sys/sys/_rmlock.h ============================================================================== --- stable/9/sys/sys/_rmlock.h Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/sys/_rmlock.h Wed Oct 2 18:45:37 2013 (r256001) @@ -44,14 +44,17 @@ LIST_HEAD(rmpriolist,rm_priotracker); struct rmlock { - struct lock_object lock_object; + struct lock_object lock_object; volatile cpuset_t rm_writecpus; LIST_HEAD(,rm_priotracker) rm_activeReaders; union { + struct lock_object _rm_wlock_object; struct mtx _rm_lock_mtx; struct sx _rm_lock_sx; } _rm_lock; }; + +#define rm_wlock_object _rm_lock._rm_wlock_object #define rm_lock_mtx _rm_lock._rm_lock_mtx #define rm_lock_sx _rm_lock._rm_lock_sx Modified: stable/9/sys/sys/cpuset.h ============================================================================== --- stable/9/sys/sys/cpuset.h Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/sys/cpuset.h Wed Oct 2 18:45:37 2013 (r256001) @@ -216,6 +216,9 @@ int cpuset_setproc_update_set(struct pro int cpusetobj_ffs(const cpuset_t *); char *cpusetobj_strprint(char *, const cpuset_t *); int cpusetobj_strscan(cpuset_t *, const char *); +#ifdef DDB +void ddb_display_cpuset(const cpuset_t *); +#endif #else __BEGIN_DECLS Modified: stable/9/sys/sys/lock.h ============================================================================== --- stable/9/sys/sys/lock.h Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/sys/lock.h Wed Oct 2 18:45:37 2013 (r256001) @@ -192,6 +192,7 @@ extern struct lock_class lock_class_mtx_ extern struct lock_class lock_class_sx; extern struct lock_class lock_class_rw; extern struct lock_class lock_class_rm; +extern struct lock_class lock_class_rm_sleepable; extern struct lock_class lock_class_lockmgr; extern struct lock_class *lock_classes[]; Modified: stable/9/sys/sys/rmlock.h ============================================================================== --- stable/9/sys/sys/rmlock.h Wed Oct 2 18:23:46 2013 (r256000) +++ stable/9/sys/sys/rmlock.h Wed Oct 2 18:45:37 2013 (r256001) @@ -65,6 +65,10 @@ void _rm_wunlock(struct rmlock *rm); int _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock); void _rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker); +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +void _rm_assert(struct rmlock *rm, int what, const char *file, + int line); +#endif /* * Public interface for lock operations. @@ -89,6 +93,9 @@ void _rm_runlock(struct rmlock *rm, str #define rm_try_rlock(rm,tracker) _rm_rlock((rm),(tracker), 1) #define rm_runlock(rm,tracker) _rm_runlock((rm), (tracker)) #endif +#define rm_sleep(chan, rm, pri, wmesg, timo) \ + _sleep((chan), &(rm)->lock_object, (pri), (wmesg), \ + tick_sbt * (timo), 0, C_HARDCLOCK) struct rm_args { struct rmlock *ra_rm; @@ -123,5 +130,20 @@ struct rm_args_flags { SYSUNINIT(name##_rm_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ rm_destroy, (rm)) +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +#define RA_LOCKED LA_LOCKED +#define RA_RLOCKED LA_SLOCKED +#define RA_WLOCKED LA_XLOCKED +#define RA_UNLOCKED LA_UNLOCKED +#define RA_RECURSED LA_RECURSED +#define RA_NOTRECURSED LA_NOTRECURSED +#endif + +#ifdef INVARIANTS +#define rm_assert(rm, what) _rm_assert((rm), (what), LOCK_FILE, LOCK_LINE) +#else +#define rm_assert(rm, what) +#endif + #endif /* _KERNEL */ #endif /* !_SYS_RMLOCK_H_ */ From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 18:51:55 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 331FDD16; Wed, 2 Oct 2013 18:51:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B20920A4; Wed, 2 Oct 2013 18:51:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92Iptco021132; Wed, 2 Oct 2013 18:51:55 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92Ipnb3021018; Wed, 2 Oct 2013 18:51:49 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201310021851.r92Ipnb3021018@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 2 Oct 2013 18:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256002 - in stable/9: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs cddl/contrib/ope... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 18:51:55 -0000 Author: pfg Date: Wed Oct 2 18:51:48 2013 New Revision: 256002 URL: http://svnweb.freebsd.org/changeset/base/256002 Log: MFC r250574, r250812, r253725; DTrace: option for time-ordered output Merge changes from illumos: 3021 option for time-ordered output from dtrace(1M) 3022 DTrace: keys should not affect the sort order when sorting by value 3023 it should be possible to dereference dynamic variables 3024 D integer narrowing needs some work 3025 register leak in D code generation This brings yet another feature implemented in upstream DTrace. A complete description is available here: http://dtrace.org/blogs/ahl/2012/07/28/my-new-dtrace-favorite/ This change bumps the DT_VERS_* number to 1.9.1 in accordance to what is done in illumos. Special thanks to Mark Johnston for fixes and testing. Illumos Revisions: 13758:23432da34147 Reference: https://www.illumos.org/issues/3021 https://www.illumos.org/issues/3022 https://www.illumos.org/issues/3023 https://www.illumos.org/issues/3024 https://www.illumos.org/issues/3025 https://www.illumos.org/issues/1694 Obtained from: Illumos Added: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/ - copied from r250812, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh - copied unchanged from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh - copied unchanged from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d - copied unchanged from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out - copied unchanged from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.c - copied unchanged from r250574, head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.h - copied unchanged from r250574, head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.h Deleted: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c stable/9/cddl/lib/libdtrace/Makefile stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/cddl/contrib/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) stable/9/cddl/lib/ (props changed) stable/9/cddl/lib/libdtrace/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Oct 2 18:51:48 2013 (r256002) @@ -23,8 +23,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #include #include @@ -1409,6 +1410,7 @@ main(int argc, char *argv[]) (void) dtrace_setopt(g_dtp, "bufsize", "4m"); (void) dtrace_setopt(g_dtp, "aggsize", "4m"); #endif + (void) dtrace_setopt(g_dtp, "temporal", "yes"); /* * If -G is specified, enable -xlink=dynamic and -xunodefs to permit Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Wed Oct 2 18:51:48 2013 (r256002) @@ -583,6 +583,8 @@ if ($opt_x) { die "$PNAME: failed to open $PNAME.$$.log: $!\n" unless (!$opt_l || open(LOG, ">$PNAME.$$.log")); +$ENV{'DTRACE_DEBUG_REGSET'} = 'true'; + if ($opt_g) { $ENV{'UMEM_DEBUG'} = 'default,verbose'; $ENV{'UMEM_LOGGING'} = 'fail,contents'; Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d) @@ -0,0 +1,35 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option quiet + +/* + * Make sure the sizes of compatible keys doesn't affect the sort order. + */ + +BEGIN +{ + @[(int)1, 0] = sum(10); + @[(uint64_t)2, 0] = sum(20); + @[(int)3, 0] = sum(30); + @[(uint64_t)4, 0] = sum(40); + printa(@); + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out) @@ -0,0 +1,6 @@ + + 1 0 10 + 2 0 20 + 3 0 30 + 4 0 40 + Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out) @@ -0,0 +1,8 @@ +The value of i is 6 +The value of i is 18 +The value of i is 72 +The value of i is 25920 +The value of i is 935761216 +The value of i is -91738734 +The value of i is -91738729 + Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d) @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test compile-time casting between integer types of different size. + */ + +#pragma D option quiet + +int64_t x; + +BEGIN +{ + x = (int32_t)(int16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (int32_t)(uint16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(int16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(uint16_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + printf("\n"); + + x = (int16_t)(int32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (int16_t)(uint32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(int32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(uint32_t)0xfff0; + printf("%16x %20d %20u\n", x, x, x); + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out) @@ -0,0 +1,10 @@ +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fffffff0 4294967280 4294967280 + fff0 65520 65520 + +fffffffffffffff0 -16 18446744073709551600 +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fff0 65520 65520 + Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d) @@ -0,0 +1,36 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test narrowing at assignment. + */ + +#pragma D option quiet + +uint16_t x; +uint32_t y; + +BEGIN +{ + x = 0xbeefcafe; + y = x; + printf("%x", y); /* where's the beef? */ + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out) @@ -0,0 +1 @@ +cafe Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d) @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Test execution-time casting between integer types of different size. + */ + +#pragma D option quiet + +int64_t x; + +BEGIN +{ + z = 0xfff0; + + x = (int32_t)(int16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (int32_t)(uint16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(int16_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint32_t)(uint16_t)z; + printf("%16x %20d %20u\n", x, x, x); + printf("\n"); + + x = (int16_t)(int32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (int16_t)(uint32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(int32_t)z; + printf("%16x %20d %20u\n", x, x, x); + x = (uint16_t)(uint32_t)z; + printf("%16x %20d %20u\n", x, x, x); + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out) @@ -0,0 +1,10 @@ +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fffffff0 4294967280 4294967280 + fff0 65520 65520 + +fffffffffffffff0 -16 18446744073709551600 +fffffffffffffff0 -16 18446744073709551600 + fff0 65520 65520 + fff0 65520 65520 + Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Wed Oct 2 18:51:48 2013 (r256002) @@ -23,26 +23,29 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: * Positive test for fill buffer policy. * * SECTION: Buffers and Buffering/fill Policy; - * Buffers and Buffering/Buffer Sizes; + * Buffers and Buffering/Buffer Sizes; * Options and Tunables/bufsize; * Options and Tunables/bufpolicy; * Options and Tunables/statusrate */ /* - * This is a brute-force way of testing fill buffers. We assume that each - * printf() stores 8 bytes. Because each fill buffer is per-CPU, we must - * fill up our buffer in one series of enablings on a single CPU. + * This is a brute-force way of testing fill buffers. We assume that + * each printf() stores 16 bytes (4x 32-bit words for EPID, timestamp + * lo, timestamp hi, and the variable i). Because each fill buffer is + * per-CPU, we must fill up our buffer in one series of enablings on a + * single CPU. */ #pragma D option bufpolicy=fill -#pragma D option bufsize=64 +#pragma D option bufsize=128 #pragma D option statusrate=10ms #pragma D option quiet Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh (from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh Wed Oct 2 18:51:48 2013 (r256002, copy of r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh) @@ -0,0 +1,106 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +############################################################################ +# ASSERTION: +# temporal option causes output to be sorted +# +# SECTION: Pragma +# +# NOTES: The temporal option has no effect on a single-CPU system, so +# this needs to be run on a multi-CPU system to effectively test the +# temporal option. +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +file=/tmp/out.$$ + +rm -f $file + +$dtrace -o $file -c 'sleep 3' -s /dev/stdin < $file.2 + +sort -n $file.2 | diff $file.2 - +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: output is not sorted + exit $status +fi + +head -n 1 $file.2 | grep begin >/dev/null +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: begin probe did not fire + exit $status +fi + +tail -n 2 $file.2 | grep end >/dev/null +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: end probe did not fire + exit $status +fi + +if [ $(tail -n 1 $file.2 | cut -f3 -d ' ') -ne \ + $(wc -l $file.2) ]; then + echo $tst: incorrect number of lines output + exit 1 +fi + +exit $status Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh (from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh Wed Oct 2 18:51:48 2013 (r256002, copy of r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh) @@ -0,0 +1,102 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +############################################################################ +# ASSERTION: +# temporal option causes output to be sorted, even when some +# buffers are empty +# +# SECTION: Pragma +# +# NOTES: The temporal option has no effect on a single-CPU system, so +# this needs to be run on a multi-CPU system to effectively test the +# temporal option. +# +############################################################################ + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 +file=/tmp/out.$$ + +rm -f $file + +$dtrace -o $file -s /dev/stdin < $file.2 + +sort -n $file.2 | diff $file.2 - +status=$? +if [ "$status" -ne 0 ]; then + echo $tst: output is not sorted + exit $status +fi + +exit $status Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d (from r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d Wed Oct 2 18:51:48 2013 (r256002, copy of r250574, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d) @@ -0,0 +1,48 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * This test excercises the "remnant" handling of the temporal option. + * At the end of one pass of retrieving and printing data from all CPUs, + * some unprocessed data will remain, because its timestamp is after the + * time covered by all CPUs' buffers. This unprocessed data is + * rearranged in a more space-efficient manner. If this is done + * incorrectly, an alignment error may occur. To test this, we use a + * high-frequency probe so that data will be recorded in subsequent + * CPU's buffers after the first CPU's buffer is obtained. The + * combination of data traced here (a 8-byte value and a 4-byte value) + * is effective to cause alignment problems with an incorrect + * implementation. + * + * This test needs to be run on a multi-CPU system to be effective. + */ + +#pragma D option quiet +#pragma D option temporal + +profile-4997 +{ + printf("%u %u", 1ULL, 2); +} + +tick-1 +/i++ == 10/ +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d) @@ -0,0 +1,28 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + print(*curpsinfo); +} + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d) @@ -0,0 +1,42 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +#pragma D option quiet + +typedef struct pancakes { + int i; + string s; + timespec_t t; +} pancakes_t; + +translator pancakes_t < void *V > { + i = 2 * 10; + s = strjoin("I like ", "pancakes"); + t = *(timespec_t *)`dtrace_zero; +}; + +BEGIN +{ + print(*(xlate < pancakes_t * > ((void *)NULL))); +} + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out) @@ -0,0 +1,8 @@ +pancakes_t { + int i = 0x14 + string s = [ "I like pancakes" ] + timespec_t t = { + time_t tv_sec = 0 + long tv_nsec = 0 + } +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out Wed Oct 2 18:51:48 2013 (r256002) @@ -1,6 +1,6 @@ -239 -52719 +-17 +-12817 -1867788817 1311768467294899695 Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d) @@ -0,0 +1,38 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Check %d v. %i v. %u. + */ + +#pragma D option quiet + +uint16_t x; +int16_t y; + +BEGIN +{ + x = 0xffffffff; + y = 0xffffffff; + + printf("%d %i %u\n", x, x, x); + printf("%d %i %u\n", y, y, y); + + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out) @@ -0,0 +1,3 @@ +65535 -1 65535 +-1 -1 65535 + Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d Wed Oct 2 18:51:48 2013 (r256002) @@ -24,7 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + /* * ASSERTION: @@ -35,17 +38,10 @@ * * NOTES: This test behaves differently depending on the values * assigned to bufsize. - * 1. 0 > bufsize. - * 2. 0 == bufsize. - * 3. 0 < bufsize <= 7 - * 4. 8 <= bufsize <= 31 - * 5. 32 <= bufsize <= 47 - * 6. 48 <= bufsize <= 71 - * 7. 72 <= bufsize */ #pragma D option quiet -#pragma D option bufsize=41 +#pragma D option bufsize=49 BEGIN { Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d) @@ -0,0 +1,28 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + trace(*curpsinfo); +} + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh) @@ -0,0 +1,62 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test the output for stable translations. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -v -s /dev/stdin < (curthread); + +#pragma D attributes Stable/Stable/Common myinfo + +BEGIN +{ + this->a = myinfo->pr_flag; + exit(0); +} + +BEGIN +{ + exit(1); +} +EOF + +exit $? Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out) @@ -0,0 +1,14 @@ + +Stability attributes for script /dev/stdin: + + Minimum Probe Description Attributes + Identifier Names: Unstable + Data Semantics: Unstable + Dependency Class: Common + + Minimum Statement Attributes + Identifier Names: Stable + Data Semantics: Stable + Dependency Class: Common + + Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh) @@ -0,0 +1,60 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# +# Copyright (c) 2012 by Delphix. All rights reserved. +# + +# +# Test the output of unstable translations. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -v -s /dev/stdin < (curthread); + +BEGIN +{ + this->a = myinfo->pr_flag; + exit(0); +} + +BEGIN +{ + exit(1); +} +EOF + +exit $? Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out (from r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out Wed Oct 2 18:51:48 2013 (r256002, copy of r253725, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out) @@ -0,0 +1,14 @@ + +Stability attributes for script /dev/stdin: + + Minimum Probe Description Attributes + Identifier Names: Unstable + Data Semantics: Unstable + Dependency Class: Common + + Minimum Statement Attributes + Identifier Names: Private + Data Semantics: Private + Dependency Class: Unknown + + Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c Wed Oct 2 18:51:48 2013 (r256002) @@ -26,6 +26,7 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -894,33 +895,14 @@ dt_aggregate_valcmp(const void *lhs, con caddr_t rdata = rh->dtahe_data.dtada_data; dtrace_recdesc_t *lrec, *rrec; int64_t *laddr, *raddr; - int rval, i; - - if ((rval = dt_aggregate_hashcmp(lhs, rhs)) != 0) - return (rval); - - if (lagg->dtagd_nrecs > ragg->dtagd_nrecs) - return (DT_GREATERTHAN); - - if (lagg->dtagd_nrecs < ragg->dtagd_nrecs) - return (DT_LESSTHAN); + int rval; - for (i = 0; i < lagg->dtagd_nrecs; i++) { - lrec = &lagg->dtagd_rec[i]; - rrec = &ragg->dtagd_rec[i]; + assert(lagg->dtagd_nrecs == ragg->dtagd_nrecs); - if (lrec->dtrd_offset < rrec->dtrd_offset) - return (DT_LESSTHAN); - - if (lrec->dtrd_offset > rrec->dtrd_offset) - return (DT_GREATERTHAN); + lrec = &lagg->dtagd_rec[lagg->dtagd_nrecs - 1]; + rrec = &ragg->dtagd_rec[ragg->dtagd_nrecs - 1]; - if (lrec->dtrd_action < rrec->dtrd_action) - return (DT_LESSTHAN); - - if (lrec->dtrd_action > rrec->dtrd_action) - return (DT_GREATERTHAN); - } + assert(lrec->dtrd_action == rrec->dtrd_action); laddr = (int64_t *)(uintptr_t)(ldata + lrec->dtrd_offset); raddr = (int64_t *)(uintptr_t)(rdata + rrec->dtrd_offset); Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Oct 2 18:45:37 2013 (r256001) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Oct 2 18:51:48 2013 (r256002) @@ -22,7 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, Joyent Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 19:06:05 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B6B0C1B6; Wed, 2 Oct 2013 19:06:05 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A41D4215E; Wed, 2 Oct 2013 19:06:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92J658Z033900; Wed, 2 Oct 2013 19:06:05 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92J65Ji033898; Wed, 2 Oct 2013 19:06:05 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201310021906.r92J65Ji033898@svn.freebsd.org> From: Colin Percival Date: Wed, 2 Oct 2013 19:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256003 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 19:06:05 -0000 Author: cperciva Date: Wed Oct 2 19:06:05 2013 New Revision: 256003 URL: http://svnweb.freebsd.org/changeset/base/256003 Log: MFC r255878: Now that the portsnap buildbox is generating the raw bits for INDEX-10, add it to the set of INDEX files built by portsnap. Modified: stable/9/etc/portsnap.conf Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/portsnap.conf ============================================================================== --- stable/9/etc/portsnap.conf Wed Oct 2 18:51:48 2013 (r256002) +++ stable/9/etc/portsnap.conf Wed Oct 2 19:06:05 2013 (r256003) @@ -33,3 +33,4 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb INDEX INDEX-7 DESCRIBE.7 INDEX INDEX-8 DESCRIBE.8 INDEX INDEX-9 DESCRIBE.9 +INDEX INDEX-10 DESCRIBE.10 From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 19:18:04 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 86C1E828; Wed, 2 Oct 2013 19:18:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63AC52219; Wed, 2 Oct 2013 19:18:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92JI4iK045401; Wed, 2 Oct 2013 19:18:04 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92JI0iP045342; Wed, 2 Oct 2013 19:18:00 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201310021918.r92JI0iP045342@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 2 Oct 2013 19:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256004 - in stable/9/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/funcs cmd/dtrace/test/tst/common/pointers cmd/dtrace/test/tst/common/print cmd/dtrace/test/tst/common/safety c... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 19:18:04 -0000 Author: pfg Date: Wed Oct 2 19:18:00 2013 New Revision: 256004 URL: http://svnweb.freebsd.org/changeset/base/256004 Log: MFC r249426; Merge change from illumos: 3519 DTrace fails to resolve const types from fbt 3520 dtrace internal error -- token type 316 is not a valid D compilation token 3521 clean up dtrace unit tests Illumos Revision: e98f46c Reference: https://www.illumos.org/issues/3519 https://www.illumos.org/issues/3520 https://www.illumos.org/issues/3521 Tested by: Fabian Keil Obtained from: Illumos Added: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d - copied unchanged from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d - copied unchanged from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d - copied unchanged from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/cddl/contrib/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ #pragma D option quiet @@ -36,3 +38,8 @@ BEGIN printf("%s\n", strjoin("", "")); exit(0); } + +BEGIN +{ + exit(1); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: This test reproduces the alignment error. @@ -39,9 +41,10 @@ BEGIN { - x = (int *) 64; + x = (int *)64; y = *x; trace(y); + exit(0); } ERROR Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -44,6 +46,7 @@ BEGIN y = (int *) (x - 3300778156056); *y = 3; trace(*y); + exit(0); } ERROR Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -39,9 +41,10 @@ BEGIN { - y = (int *) (-33007); + y = (int *)-33007; *y = 3; trace(*y); + exit(0); } ERROR Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: Demonstrating valid memory access. @@ -40,10 +42,11 @@ BEGIN { x = (int *)alloca(sizeof (int)); - printf("Address x: %x\n", (int) x); - y = (int *) (x - 2); + printf("Address x: %x\n", (int)x); + y = (int *)(x - 2); *y = 3; - printf("Address y: %x\tValue: %d\n", (int) y, *y); + printf("Address y: %x\tValue: %d\n", (int)y, *y); + exit(0); } ERROR Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d (from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d Wed Oct 2 19:18:00 2013 (r256004, copy of r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + @ = count(); + print(@); +} + +BEGIN +{ + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d Wed Oct 2 19:18:00 2013 (r256004) @@ -20,10 +20,15 @@ */ /* - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ BEGIN { print((void)`p0); } + +BEGIN +{ + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d Wed Oct 2 19:18:00 2013 (r256004) @@ -20,10 +20,15 @@ */ /* - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ BEGIN { print(); } + +BEGIN +{ + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -39,7 +41,7 @@ */ -#pragma D option bufsize=16 +#pragma D option bufsize=32 #pragma D option bufpolicy=ring #pragma D option statusrate=1nsec Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,8 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -39,3 +40,8 @@ BEGIN trace(); } + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d (from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d Wed Oct 2 19:18:00 2013 (r256004, copy of r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +BEGIN +{ + @ = count(); + trace(@); +} + +BEGIN +{ + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d Wed Oct 2 19:18:00 2013 (r256004) @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * ASSERTION: @@ -37,3 +39,8 @@ BEGIN { trace((void)`kmem_flags); } + +BEGIN +{ + exit(0); +} Copied: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d (from r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d Wed Oct 2 19:18:00 2013 (r256004, copy of r253726, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + +/* + * Make sure we can scope types with modifiers. + */ + +BEGIN +{ + trace((D`int *)0); + trace((const D`int *)0); + exit(0); +} Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Oct 2 19:18:00 2013 (r256004) @@ -677,6 +677,12 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_no "%s( ) may not be applied to a translated pointer\n", act); } + if (dnp->dn_args->dn_kind == DT_NODE_AGG) { + dnerror(dnp->dn_args, istrace ? D_TRACE_AGG : D_PRINT_AGG, + "%s( ) may not be applied to an aggregation%s\n", act, + istrace ? "" : " -- did you mean printa()?"); + } + dt_cg(yypcb, dnp->dn_args); /* Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c Wed Oct 2 19:18:00 2013 (r256004) @@ -21,6 +21,7 @@ */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. * Use is subject to license terms. */ @@ -254,11 +255,6 @@ dt_decl_spec(ushort_t kind, char *name) ddp->dd_kind = kind; ddp->dd_name = name; - if (name != NULL && strchr(name, '`') != NULL) { - xyerror(D_DECL_SCOPE, "D scoping operator may not be used " - "in a type name\n"); - } - return (dt_decl_check(ddp)); } Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Wed Oct 2 19:06:05 2013 (r256003) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Wed Oct 2 19:18:00 2013 (r256004) @@ -190,8 +190,10 @@ typedef enum { D_PRINTA_AGGPROTO, /* printa() aggregation mismatch */ D_TRACE_VOID, /* trace() argument has void type */ D_TRACE_DYN, /* trace() argument has dynamic type */ + D_TRACE_AGG, /* trace() argument is an aggregation */ D_PRINT_VOID, /* print() argument has void type */ D_PRINT_DYN, /* print() argument has dynamic type */ + D_PRINT_AGG, /* print() argument is an aggregation */ D_TRACEMEM_ADDR, /* tracemem() address bad type */ D_TRACEMEM_SIZE, /* tracemem() size bad type */ D_TRACEMEM_ARGS, /* tracemem() illegal number of args */ From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 19:20:15 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D34D98D; Wed, 2 Oct 2013 19:20:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89557222E; Wed, 2 Oct 2013 19:20:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92JKFxg046925; Wed, 2 Oct 2013 19:20:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92JKFWQ046924; Wed, 2 Oct 2013 19:20:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201310021920.r92JKFWQ046924@svn.freebsd.org> From: John Baldwin Date: Wed, 2 Oct 2013 19:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256005 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 19:20:15 -0000 Author: jhb Date: Wed Oct 2 19:20:15 2013 New Revision: 256005 URL: http://svnweb.freebsd.org/changeset/base/256005 Log: MFC 233422,233680,233681,237619,239904,249373,252346,252379,252423: Sync locking(9) with HEAD. The only change not merged is that 9 still supports !MPSAFE filesystems. Modified: stable/9/share/man/man9/locking.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/locking.9 ============================================================================== --- stable/9/share/man/man9/locking.9 Wed Oct 2 19:18:00 2013 (r256004) +++ stable/9/share/man/man9/locking.9 Wed Oct 2 19:20:15 2013 (r256005) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2012 +.Dd June 30, 2013 .Dt LOCKING 9 .Os .Sh NAME @@ -33,44 +33,51 @@ .Sh DESCRIPTION The .Em FreeBSD -kernel is written to run across multiple CPUs and as such requires -several different synchronization primitives to allow the developers -to safely access and manipulate the many data types required. +kernel is written to run across multiple CPUs and as such provides +several different synchronization primitives to allow developers +to safely access and manipulate many data types. .Ss Mutexes -Mutexes (also called "sleep mutexes") are the most commonly used +Mutexes (also called "blocking mutexes") are the most commonly used synchronization primitive in the kernel. -Thread acquires (locks) a mutex before accessing data shared with other +A thread acquires (locks) a mutex before accessing data shared with other threads (including interrupt threads), and releases (unlocks) it afterwards. -If the mutex cannot be acquired, the thread requesting it will sleep. +If the mutex cannot be acquired, the thread requesting it will wait. +Mutexes are adaptive by default, meaning that +if the owner of a contended mutex is currently running on another CPU, +then a thread attempting to acquire the mutex will spin rather than yielding +the processor. Mutexes fully support priority propagation. .Pp See .Xr mutex 9 for details. -.Ss Spin mutexes -Spin mutexes are variation of basic mutexes; the main difference between -the two is that spin mutexes never sleep - instead, they spin, waiting -for the thread holding the lock, which runs on another CPU, to release it. -Differently from ordinary mutex, spin mutexes disable interrupts when acquired. -Since disabling interrupts is expensive, they are also generally slower. -Spin mutexes should be used only when necessary, e.g. to protect data shared +.Ss Spin Mutexes +Spin mutexes are a variation of basic mutexes; the main difference between +the two is that spin mutexes never block. +Instead, they spin while waiting for the lock to be released. +To avoid deadlock, a thread that holds a spin mutex must never yield its CPU. +Unlike ordinary mutexes, spin mutexes disable interrupts when acquired. +Since disabling interrupts can be expensive, they are generally slower to +acquire and release. +Spin mutexes should be used only when absolutely necessary, +e.g. to protect data shared with interrupt filter code (see .Xr bus_setup_intr 9 -for details). -.Ss Pool mutexes -With most synchronization primitives, such as mutexes, programmer must -provide a piece of allocated memory to hold the primitive. +for details), +or for scheduler internals. +.Ss Mutex Pools +With most synchronization primitives, such as mutexes, the programmer must +provide memory to hold the primitive. For example, a mutex may be embedded inside the structure it protects. -Pool mutex is a variant of mutex without this requirement - to lock or unlock -a pool mutex, one uses address of the structure being protected with it, -not the mutex itself. -Pool mutexes are seldom used. +Mutex pools provide a preallocated set of mutexes to avoid this +requirement. +Note that mutexes from a pool may only be used as leaf locks. .Pp See .Xr mtx_pool 9 for details. -.Ss Reader/writer locks -Reader/writer locks allow shared access to protected data by multiple threads, +.Ss Reader/Writer Locks +Reader/writer locks allow shared access to protected data by multiple threads or exclusive access by a single thread. The threads with shared access are known as .Em readers @@ -82,26 +89,16 @@ since it may modify protected data. Reader/writer locks can be treated as mutexes (see above and .Xr mutex 9 ) with shared/exclusive semantics. -More specifically, regular mutexes can be -considered to be equivalent to a write-lock on an -.Em rw_lock. -The -.Em rw_lock -locks have priority propagation like mutexes, but priority -can be propagated only to an exclusive holder. +Reader/writer locks support priority propagation like mutexes, +but priority is propagated only to an exclusive holder. This limitation comes from the fact that shared owners are anonymous. -Another important property is that shared holders of -.Em rw_lock -can recurse, but exclusive locks are not allowed to recurse. -This ability should not be used lightly and -.Em may go away. .Pp See .Xr rwlock 9 for details. -.Ss Read-mostly locks -Mostly reader locks are similar to +.Ss Read-Mostly Locks +Read-mostly locks are similar to .Em reader/writer locks but optimized for very infrequent write locking. .Em Read-mostly @@ -113,21 +110,41 @@ data structure. See .Xr rmlock 9 for details. +.Ss Sleepable Read-Mostly Locks +Sleepable read-mostly locks are a variation on read-mostly locks. +Threads holding an exclusive lock may sleep, +but threads holding a shared lock may not. +Priority is propagated to shared owners but not to exclusive owners. .Ss Shared/exclusive locks Shared/exclusive locks are similar to reader/writer locks; the main difference -between them is that shared/exclusive locks may be held during unbounded sleep -(and may thus perform an unbounded sleep). -They are inherently less efficient than mutexes, reader/writer locks -and read-mostly locks. -They don't support priority propagation. -They should be considered to be closely related to -.Xr sleep 9 . -In fact it could in some cases be -considered a conditional sleep. +between them is that shared/exclusive locks may be held during unbounded sleep. +Acquiring a contested shared/exclusive lock can perform an unbounded sleep. +These locks do not support priority propagation. .Pp See .Xr sx 9 for details. +.Ss Lockmanager locks +Lockmanager locks are sleepable shared/exclusive locks used mostly in +.Xr VFS 9 +.Po +as a +.Xr vnode 9 +lock +.Pc +and in the buffer cache +.Po +.Xr BUF_LOCK 9 +.Pc . +They have features other lock types do not have such as sleep +timeouts, blocking upgrades, +writer starvation avoidance, draining, and an interlock mutex, +but this makes them complicated both to use and to implement; +for this reason, they should be avoided. +.Pp +See +.Xr lock 9 +for details. .Ss Counting semaphores Counting semaphores provide a mechanism for synchronizing access to a pool of resources. @@ -140,43 +157,21 @@ See .Xr sema 9 for details. .Ss Condition variables -Condition variables are used in conjunction with mutexes to wait for -conditions to occur. -A thread must hold the mutex before calling the -.Fn cv_wait* , +Condition variables are used in conjunction with locks to wait for +a condition to become true. +A thread must hold the associated lock before calling one of the +.Fn cv_wait , functions. -When a thread waits on a condition, the mutex -is atomically released before the thread is blocked, then reacquired -before the function call returns. +When a thread waits on a condition, the lock +is atomically released before the thread yields the processor +and reacquired before the function call returns. +Condition variables may be used with blocking mutexes, +reader/writer locks, read-mostly locks, and shared/exclusive locks. .Pp See .Xr condvar 9 for details. -.Ss Giant -Giant is an instance of a mutex, with some special characteristics: -.Bl -enum -.It -It is recursive. -.It -Drivers and filesystems can request that Giant be locked around them -by not marking themselves MPSAFE. -Note that infrastructure to do this is slowly going away as non-MPSAFE -drivers either became properly locked or disappear. -.It -Giant must be locked first before other locks. -.It -It is OK to hold Giant while performing unbounded sleep; in such case, -Giant will be dropped before sleeping and picked up after wakeup. -.It -There are places in the kernel that drop Giant and pick it back up -again. -Sleep locks will do this before sleeping. -Parts of the network or VM code may do this as well, depending on the -setting of a sysctl. -This means that you cannot count on Giant keeping other code from -running if your code sleeps, even if you want it to. -.El -.Ss Sleep/wakeup +.Ss Sleep/Wakeup The functions .Fn tsleep , .Fn msleep , @@ -185,7 +180,12 @@ The functions .Fn wakeup , and .Fn wakeup_one -handle event-based thread blocking. +also handle event-based thread blocking. +Unlike condition variables, +arbitrary addresses may be used as wait channels and a dedicated +structure does not need to be allocated. +However, care must be taken to ensure that wait channel addresses are +unique to an event. If a thread must wait for an external event, it is put to sleep by .Fn tsleep , .Fn msleep , @@ -205,9 +205,10 @@ the thread is being put to sleep. All threads sleeping on a single .Fa chan are woken up later by -.Fn wakeup , -often called from inside an interrupt routine, to indicate that the -resource the thread was blocking on is available now. +.Fn wakeup +.Pq often called from inside an interrupt routine +to indicate that the +event the thread was blocking on has occurred. .Pp Several of the sleep functions including .Fn msleep , @@ -223,126 +224,170 @@ includes the flag, then the lock will not be reacquired before returning. The lock is used to ensure that a condition can be checked atomically, and that the current thread can be suspended without missing a -change to the condition, or an associated wakeup. +change to the condition or an associated wakeup. In addition, all of the sleep routines will fully drop the .Va Giant mutex -(even if recursed) +.Pq even if recursed while the thread is suspended and will reacquire the .Va Giant -mutex before the function returns. -.Pp -See -.Xr sleep 9 -for details. +mutex +.Pq restoring any recursion +before the function returns. .Pp -.Ss Lockmanager locks -Shared/exclusive locks, used mostly in -.Xr VFS 9 , -in particular as a -.Xr vnode 9 -lock. -They have features other lock types don't have, such as sleep timeout, -writer starvation avoidance, draining, and interlock mutex, but this makes them -complicated to implement; for this reason, they are deprecated. +The +.Fn pause +function is a special sleep function that waits for a specified +amount of time to pass before the thread resumes execution. +This sleep cannot be terminated early by either an explicit +.Fn wakeup +or a signal. .Pp See -.Xr lock 9 +.Xr sleep 9 for details. +.Ss Giant +Giant is a special mutex used to protect data structures that do not +yet have their own locks. +Since it provides semantics akin to the old +.Xr spl 9 +interface, +Giant has special characteristics: +.Bl -enum +.It +It is recursive. +.It +Drivers and filesystems can request that Giant be locked around them +by not marking themselves MPSAFE. +Note that infrastructure to do this is slowly going away as non-MPSAFE +drivers either became properly locked or disappear. +.It +Giant must be locked before other non-sleepable locks. +.It +Giant is dropped during unbounded sleeps and reacquired after wakeup. +.It +There are places in the kernel that drop Giant and pick it back up +again. +Sleep locks will do this before sleeping. +Parts of the network or VM code may do this as well. +This means that you cannot count on Giant keeping other code from +running if your code sleeps, even if you want it to. +.El .Sh INTERACTIONS -The primitives interact and have a number of rules regarding how +The primitives can interact and have a number of rules regarding how they can and can not be combined. -Many of these rules are checked using the -.Xr witness 4 -code. -.Ss Bounded vs. unbounded sleep -The following primitives perform bounded sleep: mutexes, pool mutexes, -reader/writer locks and read-mostly locks. -.Pp -The following primitives block (perform unbounded sleep): shared/exclusive locks, -counting semaphores, condition variables, sleep/wakeup and lockmanager locks. -.Pp -It is an error to do any operation that could result in any kind of sleep while -holding spin mutex. -.Pp -As a general rule, it is an error to do any operation that could result -in unbounded sleep while holding any primitive from the 'bounded sleep' group. -For example, it is an error to try to acquire shared/exclusive lock while -holding mutex, or to try to allocate memory with M_WAITOK while holding -read-write lock. +Many of these rules are checked by +.Xr witness 4 . +.Ss Bounded vs. Unbounded Sleep +In a bounded sleep +.Po also referred to as +.Dq blocking +.Pc +the only resource needed to resume execution of a thread +is CPU time for the owner of a lock that the thread is waiting to acquire. +In an unbounded sleep +.Po +often referred to as simply +.Dq sleeping +.Pc +a thread waits for an external event or for a condition +to become true. +In particular, +a dependency chain of threads in bounded sleeps should always make forward +progress, +since there is always CPU time available. +This requires that no thread in a bounded sleep is waiting for a lock held +by a thread in an unbounded sleep. +To avoid priority inversions, +a thread in a bounded sleep lends its priority to the owner of the lock +that it is waiting for. +.Pp +The following primitives perform bounded sleeps: +mutexes, reader/writer locks and read-mostly locks. +.Pp +The following primitives perform unbounded sleeps: +sleepable read-mostly locks, shared/exclusive locks, lockmanager locks, +counting semaphores, condition variables, and sleep/wakeup. +.Ss General Principles +.Bl -bullet +.It +It is an error to do any operation that could result in yielding the processor +while holding a spin mutex. +.It +It is an error to do any operation that could result in unbounded sleep +while holding any primitive from the 'bounded sleep' group. +For example, it is an error to try to acquire a shared/exclusive lock while +holding a mutex, or to try to allocate memory with M_WAITOK while holding a +reader/writer lock. .Pp -As a special case, it is possible to call +Note that the lock passed to one of the .Fn sleep or -.Fn mtx_sleep -while holding a single mutex. -It will atomically drop that mutex and reacquire it as part of waking up. -This is often a bad idea because it generally relies on the programmer having -good knowledge of all of the call graph above the place where -.Fn mtx_sleep -is being called and assumptions the calling code has made. -Because the lock gets dropped during sleep, one must re-test all -the assumptions that were made before, all the way up the call graph to the -place where the lock was acquired. -.Pp -It is an error to do any operation that could result in any kind of sleep when -running inside an interrupt filter. -.Pp +.Fn cv_wait +functions is dropped before the thread enters the unbounded sleep and does +not violate this rule. +.It +It is an error to do any operation that could result in yielding of +the processor when running inside an interrupt filter. +.It It is an error to do any operation that could result in unbounded sleep when running inside an interrupt thread. +.El .Ss Interaction table The following table shows what you can and can not do while holding -one of the synchronization primitives discussed: -.Bl -column ".Ic xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent -.It Xo -.Em "You have: You want:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep -.Xc -.It spin mtx Ta \&ok-1 Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no-3 -.It mutex Ta \&ok Ta \&ok-1 Ta \&no Ta \&ok Ta \&ok Ta \&no-3 -.It sx Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok Ta \&ok Ta \&ok-4 -.It rwlock Ta \&ok Ta \&ok Ta \&no Ta \&ok-2 Ta \&ok Ta \&no-3 -.It rmlock Ta \&ok Ta \&ok Ta \&no-5 Ta \&ok Ta \&ok-2 Ta \&no-5 +one of the locking primitives discussed. Note that +.Dq sleep +includes +.Fn sema_wait , +.Fn sema_timedwait , +any of the +.Fn cv_wait +functions, +and any of the +.Fn sleep +functions. +.Bl -column ".Ic xxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXXXX" ".Xr XXXXXX" -offset 3n +.It Em " You want:" Ta spin mtx Ta mutex/rw Ta rmlock Ta sleep rm Ta sx/lk Ta sleep +.It Em "You have: " Ta -------- Ta -------- Ta ------ Ta -------- Ta ------ Ta ------ +.It spin mtx Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no-1 +.It mutex/rw Ta \&ok Ta \&ok Ta \&ok Ta \&no Ta \&no Ta \&no-1 +.It rmlock Ta \&ok Ta \&ok Ta \&ok Ta \&no Ta \&no Ta \&no-1 +.It sleep rm Ta \&ok Ta \&ok Ta \&ok Ta \&ok-2 Ta \&ok-2 Ta \&ok-2/3 +.It sx Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok-3 +.It lockmgr Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok .El .Pp .Em *1 -Recursion is defined per lock. -Lock order is important. +There are calls that atomically release this primitive when going to sleep +and reacquire it on wakeup +.Po +.Fn mtx_sleep , +.Fn rw_sleep , +.Fn msleep_spin , +etc. +.Pc . .Pp .Em *2 -Readers can recurse though writers can not. -Lock order is important. +These cases are only allowed while holding a write lock on a sleepable +read-mostly lock. .Pp .Em *3 -There are calls that atomically release this primitive when going to sleep -and reacquire it on wakeup (e.g. -.Fn mtx_sleep , -.Fn rw_sleep -and -.Fn msleep_spin ) . -.Pp -.Em *4 -Though one can sleep holding an sx lock, one can also use -.Fn sx_sleep -which will atomically release this primitive when going to sleep and +Though one can sleep while holding this lock, +one can also use a +.Fn sleep +function to atomically release this primitive when going to sleep and reacquire it on wakeup. .Pp -.Em *5 -.Em Read-mostly -locks can be initialized to support sleeping while holding a write lock. -See -.Xr rmlock 9 -for details. +Note that non-blocking try operations on locks are always permitted. .Ss Context mode table The next table shows what can be used in different contexts. At this time this is a rather easy to remember table. -.Bl -column ".Ic Xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXX" -offset indent -.It Xo -.Em "Context:" Ta spin mtx Ta mutex Ta sx Ta rwlock Ta rmlock Ta sleep -.Xc +.Bl -column ".Ic Xxxxxxxxxxxxxxxxxxx" ".Xr XXXXXXXXX" ".Xr XXXXXXXXX" ".Xr XXXXXXX" ".Xr XXXXXXXXX" ".Xr XXXXXX" -offset 3n +.It Em "Context:" Ta spin mtx Ta mutex/rw Ta rmlock Ta sleep rm Ta sx/lk Ta sleep .It interrupt filter: Ta \&ok Ta \&no Ta \&no Ta \&no Ta \&no Ta \&no -.It interrupt thread: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&ok Ta \&no -.It callout: Ta \&ok Ta \&ok Ta \&no Ta \&ok Ta \&no Ta \&no -.It syscall: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok +.It interrupt thread: Ta \&ok Ta \&ok Ta \&ok Ta \&no Ta \&no Ta \&no +.It callout: Ta \&ok Ta \&ok Ta \&ok Ta \&no Ta \&no Ta \&no +.It system call: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok .El .Sh SEE ALSO .Xr witness 4 , From owner-svn-src-stable-9@FreeBSD.ORG Wed Oct 2 19:23:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2EB40AE6; Wed, 2 Oct 2013 19:23:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1AFB12266; Wed, 2 Oct 2013 19:23:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92JN2JW050522; Wed, 2 Oct 2013 19:23:02 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92JN2C8050520; Wed, 2 Oct 2013 19:23:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201310021923.r92JN2C8050520@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 2 Oct 2013 19:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256006 - stable/9/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 19:23:03 -0000 Author: pfg Date: Wed Oct 2 19:23:02 2013 New Revision: 256006 URL: http://svnweb.freebsd.org/changeset/base/256006 Log: MFC r254941; Merge a couple of CTF fixes from illumos: 2942 CTF tools need to handle files which legitimately lack data 2978 ctfconvert still needs to ignore legitimately dataless files on SPARC Illumos Revisions: 13745:6b3106b4250f 13754:7231b684c18b Reference: https://www.illumos.org/issues/2942 https://www.illumos.org/issues/2978 Obtained from: Illumos Modified: stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/cddl/contrib/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Wed Oct 2 19:20:15 2013 (r256005) +++ stable/9/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Wed Oct 2 19:23:02 2013 (r256006) @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * DWARF to tdata conversion * @@ -1758,6 +1756,59 @@ die_resolve(dwarf_t *dw) } while (dw->dw_nunres != 0); } +/* + * Any object containing a function or object symbol at any scope should also + * contain DWARF data. + */ +static boolean_t +should_have_dwarf(Elf *elf) +{ + Elf_Scn *scn = NULL; + Elf_Data *data = NULL; + GElf_Shdr shdr; + GElf_Sym sym; + uint32_t symdx = 0; + size_t nsyms = 0; + boolean_t found = B_FALSE; + + while ((scn = elf_nextscn(elf, scn)) != NULL) { + gelf_getshdr(scn, &shdr); + + if (shdr.sh_type == SHT_SYMTAB) { + found = B_TRUE; + break; + } + } + + if (!found) + terminate("cannot convert stripped objects\n"); + + data = elf_getdata(scn, NULL); + nsyms = shdr.sh_size / shdr.sh_entsize; + + for (symdx = 0; symdx < nsyms; symdx++) { + gelf_getsym(data, symdx, &sym); + + if ((GELF_ST_TYPE(sym.st_info) == STT_FUNC) || + (GELF_ST_TYPE(sym.st_info) == STT_TLS) || + (GELF_ST_TYPE(sym.st_info) == STT_OBJECT)) { + char *name; + + name = elf_strptr(elf, shdr.sh_link, sym.st_name); + + /* Studio emits these local symbols regardless */ + if ((strcmp(name, "Bbss.bss") != 0) && + (strcmp(name, "Ttbss.bss") != 0) && + (strcmp(name, "Ddata.data") != 0) && + (strcmp(name, "Ttdata.data") != 0) && + (strcmp(name, "Drodata.rodata") != 0)) + return (B_TRUE); + } + } + + return (B_FALSE); +} + /*ARGSUSED*/ int dw_read(tdata_t *td, Elf *elf, char *filename __unused) @@ -1782,8 +1833,12 @@ dw_read(tdata_t *td, Elf *elf, char *fil if ((rc = dwarf_elf_init(elf, DW_DLC_READ, &dw.dw_dw, &dw.dw_err)) == DW_DLV_NO_ENTRY) { - errno = ENOENT; - return (-1); + if (should_have_dwarf(elf)) { + errno = ENOENT; + return (-1); + } else { + return (0); + } } else if (rc != DW_DLV_OK) { if (dwarf_errno(&dw.dw_err) == DW_DLE_DEBUG_INFO_NULL) { /* @@ -1801,9 +1856,14 @@ dw_read(tdata_t *td, Elf *elf, char *fil &addrsz, &nxthdr, &dw.dw_err)) != DW_DLV_OK) terminate("rc = %d %s\n", rc, dwarf_errmsg(&dw.dw_err)); - if ((cu = die_sibling(&dw, NULL)) == NULL) + if ((cu = die_sibling(&dw, NULL)) == NULL || + (((child = die_child(&dw, cu)) == NULL) && + should_have_dwarf(elf))) { terminate("file does not contain dwarf type data " "(try compiling with -g)\n"); + } else if (child == NULL) { + return (0); + } dw.dw_maxoff = nxthdr - 1; From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 3 06:14:45 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 256B8C2D; Thu, 3 Oct 2013 06:14:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12FCA2601; Thu, 3 Oct 2013 06:14:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r936Ei5q052330; Thu, 3 Oct 2013 06:14:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r936EirI052329; Thu, 3 Oct 2013 06:14:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201310030614.r936EirI052329@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 3 Oct 2013 06:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256015 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 06:14:45 -0000 Author: kib Date: Thu Oct 3 06:14:44 2013 New Revision: 256015 URL: http://svnweb.freebsd.org/changeset/base/256015 Log: MFC r255880: Acquire a hold reference on the vnode when a knote is instantiated. Modified: stable/9/sys/kern/vfs_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Thu Oct 3 01:53:17 2013 (r256014) +++ stable/9/sys/kern/vfs_subr.c Thu Oct 3 06:14:44 2013 (r256015) @@ -4525,6 +4525,7 @@ vfs_kqfilter(struct vop_kqfilter_args *a if (vp->v_pollinfo == NULL) return (ENOMEM); knl = &vp->v_pollinfo->vpi_selinfo.si_note; + vhold(vp); knlist_add(knl, kn, 0); return (0); @@ -4540,6 +4541,7 @@ filt_vfsdetach(struct knote *kn) KASSERT(vp->v_pollinfo != NULL, ("Missing v_pollinfo")); knlist_remove(&vp->v_pollinfo->vpi_selinfo.si_note, kn, 0); + vdrop(vp); } /*ARGSUSED*/ From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 3 12:28:51 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA8E5826; Thu, 3 Oct 2013 12:28:51 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8930F2FCD; Thu, 3 Oct 2013 12:28:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93CSptg048296; Thu, 3 Oct 2013 12:28:51 GMT (envelope-from rene@svn.freebsd.org) Received: (from rene@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93CSp8N048295; Thu, 3 Oct 2013 12:28:51 GMT (envelope-from rene@svn.freebsd.org) Message-Id: <201310031228.r93CSp8N048295@svn.freebsd.org> From: Rene Ladan Date: Thu, 3 Oct 2013 12:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256020 - stable/9/usr.bin/calendar/calendars X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 12:28:51 -0000 Author: rene (doc,ports committer) Date: Thu Oct 3 12:28:51 2013 New Revision: 256020 URL: http://svnweb.freebsd.org/changeset/base/256020 Log: MFC r250198 (edwin, 2013-05-03): On 30 April 2013 queen Beatrix resigned and crownprince Willem Alexander became the new king. King's day is on 27 April. MFC r255956 (rene, 2013-09-30): Update the Dutch calendar entries: - prince Johan Friso passed away in 2013 - correct status of queen Maxima and crown princess Catharina-Amalia - language fixes Approved by: gjb (mentor) Modified: stable/9/usr.bin/calendar/calendars/calendar.dutch Directory Properties: stable/9/usr.bin/calendar/ (props changed) stable/9/usr.bin/calendar/calendars/ (props changed) Modified: stable/9/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- stable/9/usr.bin/calendar/calendars/calendar.dutch Thu Oct 3 11:51:15 2013 (r256019) +++ stable/9/usr.bin/calendar/calendars/calendar.dutch Thu Oct 3 12:28:51 2013 (r256020) @@ -13,7 +13,7 @@ Easter=Pasen jan/01 Nieuwjaar jan/06 Driekoningen apr/01 1 april -apr/30 Koninginnedag +apr/27 Koningsdag mei/01 Dag van de Arbeid mei/04 Dodenherdenking mei/05 Bevrijdingsdag @@ -22,11 +22,11 @@ nov/01 Allerheiligen nov/02 Allerzielen nov/11 Sint Maarten nov/11 Elfde-van-de-elfde -dec/05 Sinterklaas avond +dec/05 Sinterklaasavond dec/15 Koninkrijksdag dec/24 Kerstavond -dec/25 Eerste kerstdag -dec/26 Tweede kerstdag +dec/25 Eerste Kerstdag +dec/26 Tweede Kerstdag dec/28 Feest der Onnozele Kinderen dec/31 Oudjaar @@ -40,10 +40,10 @@ Pasen-47 Carnaval (Vastenavond) Pasen-46 Aswoensdag Pasen-7 Palmzondag Pasen-3 Witte Donderdag -Pasen-2 Goede vrijdag -Pasen-1 Stille zaterdag -Pasen Eerste paasdag -Pasen+1 Tweede paasdag +Pasen-2 Goede Vrijdag +Pasen-1 Stille Zaterdag +Pasen Eerste Paasdag +Pasen+1 Tweede Paasdag Pasen+39 Hemelvaartsdag Pasen+49 Eerste Pinksterdag Pasen+50 Tweede Pinksterdag @@ -60,20 +60,20 @@ sep/TueThird Prinsjesdag * Het koningshuis */ jan/19 Prinses Margriet (1943) -jan/31 Koningin Beatrix (1938) +jan/31 Prinses Beatrix (1938) feb/17 Prins Willem III (1817 - 1890) feb/18 Prinses Christina (1947) apr/10 Prinses Ariane (2007) apr/19 Prins Hendrik (1876 - 1934) -apr/27 Kroonprins Willem Alexander (1967) -apr/30 Koningin Juliana (1909 - 2004) +apr/27 Koning Willem-Alexander (1967) +apr/30 Prinses Juliana (1909 - 2004) apr/30 Mr. Pieter van Vollenhoven (1939) -mei/17 Prinses Maxima (1971) +mei/17 Koningin Maxima (1971) jun/26 Prinses Alexia (2005) jun/29 Prins Bernhard (1911 - 2004) aug/05 Prinses Irene (1939) aug/31 Prinses Wilhelmina (1880 - 1962) sep/06 Prins Claus (1925 - 2002) -sep/25 Prins Johan Friso (1968) +sep/25 Prins Johan Friso (1968 - 2013) okt/11 Prins Constantijn (1969) -dec/07 Prinses Catharina-Amalia (2003) +dec/07 Kroonprinses Catharina-Amalia (2003) From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 3 18:48:44 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3715999D; Thu, 3 Oct 2013 18:48:44 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15C6F281E; Thu, 3 Oct 2013 18:48:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93ImhDZ052040; Thu, 3 Oct 2013 18:48:43 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93ImhNg052036; Thu, 3 Oct 2013 18:48:43 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310031848.r93ImhNg052036@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 3 Oct 2013 18:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256025 - stable/9/usr.sbin/daemon X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 18:48:44 -0000 Author: trociny Date: Thu Oct 3 18:48:43 2013 New Revision: 256025 URL: http://svnweb.freebsd.org/changeset/base/256025 Log: MFC r255521, r255526, r255707: r255521 (jmg): add support for writing the pid of the daemon program to a pid file so that daemon can be used w/ rc.subr and ports can use the additional functionality, such as keeping the ldap daemon up and running, and have the proper program to signal to exit.. PR: bin/181341 Submitted by: feld r255526 (joel): mdoc: remove EOL whitespace. r255707: 1. Properly clean pid files in the case of the error. 2. Write the supervisor pid before the restart loop, so we don't uselessly rewrite it after every child restart. 3. Remove duplicate ppfh and pfh initialization. Modified: stable/9/usr.sbin/daemon/daemon.8 stable/9/usr.sbin/daemon/daemon.c Directory Properties: stable/9/usr.sbin/daemon/ (props changed) Modified: stable/9/usr.sbin/daemon/daemon.8 ============================================================================== --- stable/9/usr.sbin/daemon/daemon.8 Thu Oct 3 17:50:14 2013 (r256024) +++ stable/9/usr.sbin/daemon/daemon.8 Thu Oct 3 18:48:43 2013 (r256025) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd September 13, 2013 .Dt DAEMON 8 .Os .Sh NAME @@ -35,7 +35,8 @@ .Sh SYNOPSIS .Nm .Op Fl cfr -.Op Fl p Ar pidfile +.Op Fl p Ar child_pidfile +.Op Fl P Ar supervisor_pidfile .Op Fl u Ar user .Ar command arguments ... .Sh DESCRIPTION @@ -53,19 +54,39 @@ Change the current working directory to .It Fl f Redirect standard input, standard output and standard error to .Pa /dev/null . -.It Fl p Ar file +.It Fl p Ar child_pidfile Write the ID of the created process into the -.Ar file +.Ar child_pidfile using the .Xr pidfile 3 functionality. The program is executed in a spawned child process while the .Nm waits until it terminates to keep the -.Ar file +.Ar child_pidfile locked and removes it after the process exits. The -.Ar file +.Ar child_pidfile +owner is the user who runs the +.Nm +regardless of whether the +.Fl u +option is used or not. +.It Fl P Ar supervisor_pidfile +Write the ID of the +.Nm +process into the +.Ar supervisor_pidfile +using the +.Xr pidfile 3 +functionality. +The program is executed in a spawned child process while the +.Nm +waits until it terminates to keep the +.Ar supervisor_pidfile +locked and removes it after the process exits. +The +.Ar supervisor_pidfile owner is the user who runs the .Nm regardless of whether the @@ -79,27 +100,46 @@ Requires adequate superuser privileges. .El .Pp If the -.Fl p +.Fl p , +.Fl P or .Fl r option is specified the program is executed in a spawned child process. The .Nm -waits until it terminates to keep the pid file locked and removes it +waits until it terminates to keep the pid file(s) locked and removes them after the process exits or restarts the program. In this case if the monitoring .Nm receives software termination signal (SIGTERM) it forwards it to the spawned process. -Normally it will cause the child to exit followed by the termination -of the supervising process after removing the pidfile. +Normally it will cause the child to exit, remove the pidfile(s) +and then terminate. +.Pp +The +.Fl P +option is useful combined with the +.Fl r +option as +.Ar supervisor_pidfile +contains the ID of the supervisor +not the child. This is especially important if you use +.Fl r +in an rc script as the +.Fl p +option will give you the child's ID to signal when you attempt to +stop the service, causing +.Nm +to restart the child. .Sh EXIT STATUS The .Nm utility exits 1 if an error is returned by the .Xr daemon 3 -library routine, 2 if the -.Ar pidfile +library routine, 2 if +.Ar child_pidfile +or +.Ar supervisor_pidfile is requested, but cannot be opened, 3 if process is already running (pidfile exists and is locked), otherwise 0. Modified: stable/9/usr.sbin/daemon/daemon.c ============================================================================== --- stable/9/usr.sbin/daemon/daemon.c Thu Oct 3 17:50:14 2013 (r256024) +++ stable/9/usr.sbin/daemon/daemon.c Thu Oct 3 18:48:43 2013 (r256025) @@ -53,16 +53,16 @@ static void usage(void); int main(int argc, char *argv[]) { - struct pidfh *pfh = NULL; + struct pidfh *ppfh, *pfh; sigset_t mask, oldmask; - int ch, nochdir, noclose, restart; - const char *pidfile, *user; + int ch, nochdir, noclose, restart, serrno; + const char *pidfile, *ppidfile, *user; pid_t otherpid, pid; nochdir = noclose = 1; restart = 0; - pidfile = user = NULL; - while ((ch = getopt(argc, argv, "cfp:ru:")) != -1) { + ppidfile = pidfile = user = NULL; + while ((ch = getopt(argc, argv, "cfp:P:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -73,6 +73,9 @@ main(int argc, char *argv[]) case 'p': pidfile = optarg; break; + case 'P': + ppidfile = optarg; + break; case 'r': restart = 1; break; @@ -89,7 +92,7 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - pfh = NULL; + ppfh = pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -104,9 +107,27 @@ main(int argc, char *argv[]) err(2, "pidfile ``%s''", pidfile); } } + /* Do the same for actual daemon process. */ + if (ppidfile != NULL) { + ppfh = pidfile_open(ppidfile, 0600, &otherpid); + if (ppfh == NULL) { + serrno = errno; + pidfile_remove(pfh); + errno = serrno; + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); + } + err(2, "ppidfile ``%s''", ppidfile); + } + } - if (daemon(nochdir, noclose) == -1) - err(1, NULL); + if (daemon(nochdir, noclose) == -1) { + warn("daemon"); + goto exit; + } + /* Write out parent pidfile if needed. */ + pidfile_write(ppfh); /* * If the pidfile or restart option is specified the daemon @@ -123,22 +144,28 @@ main(int argc, char *argv[]) * Restore default action for SIGTERM in case the * parent process decided to ignore it. */ - if (signal(SIGTERM, SIG_DFL) == SIG_ERR) - err(1, "signal"); + if (signal(SIGTERM, SIG_DFL) == SIG_ERR) { + warn("signal"); + goto exit; + } /* * Because SIGCHLD is ignored by default, setup dummy handler * for it, so we can mask it. */ - if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) - err(1, "signal"); + if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) { + warn("signal"); + goto exit; + } /* * Block interesting signals. */ sigemptyset(&mask); sigaddset(&mask, SIGTERM); sigaddset(&mask, SIGCHLD); - if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) - err(1, "sigprocmask"); + if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) { + warn("sigprocmask"); + goto exit; + } /* * Try to protect against pageout kill. Ignore the * error, madvise(2) will fail only if a process does @@ -152,8 +179,8 @@ restart: */ pid = fork(); if (pid == -1) { - pidfile_remove(pfh); - err(1, "fork"); + warn("fork"); + goto exit; } } if (pid <= 0) { @@ -176,13 +203,16 @@ restart: */ err(1, "%s", argv[0]); } + setproctitle("%s[%d]", argv[0], pid); if (wait_child(pid, &mask) == 0 && restart) { sleep(1); goto restart; } +exit: pidfile_remove(pfh); - exit(0); /* Exit status does not matter. */ + pidfile_remove(ppfh); + exit(1); /* If daemon(3) succeeded exit status does not matter. */ } static void @@ -240,7 +270,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: daemon [-cfr] [-p pidfile] [-u user] command " - "arguments ...\n"); + "usage: daemon [-cfr] [-p child_pidfile] [-P supervisor_pidfile] " + "[-u user]\n command arguments ...\n"); exit(1); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 3 18:52:05 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E9613CBA; Thu, 3 Oct 2013 18:52:05 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C95272874; Thu, 3 Oct 2013 18:52:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93Iq5c4055204; Thu, 3 Oct 2013 18:52:05 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93Iq5Gl055199; Thu, 3 Oct 2013 18:52:05 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201310031852.r93Iq5Gl055199@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 3 Oct 2013 18:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256027 - stable/9/sbin/hastd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 18:52:06 -0000 Author: trociny Date: Thu Oct 3 18:52:04 2013 New Revision: 256027 URL: http://svnweb.freebsd.org/changeset/base/256027 Log: MFC r255714, r255716, r255717: r255714: Use cv_broadcast() instead of cv_signal() when waking up threads waiting on an empty queue as the queue may have several consumers. Before the fix the following scenario was possible: 2 threads are waiting on empty queue, 2 threads are inserting simultaneously. The first inserting thread detects that the queue is empty and is going to send the signal, but before it sends the second thread inserts too. When the first sends the signal only one of the waiting threads receive it while the other one may wait forever. The scenario above is is believed to be the cause of the observed cases, when ggate_recv_thread() was getting stuck on taking free request, while the free queue was not empty. Reviewed by: pjd Tested by: Yamagi Burmeister yamagi.org r255716: When updating the map of dirty extents, most recently used extents are kept dirty to reduce the number of on-disk metadata updates. The sequence of operations is: 1) acquire the activemap lock; 2) update in-memory map; 3) if the list of keepdirty extents is changed, update on-disk metadata; 4) release the lock. On-disk updates are not frequent in comparison with in-memory updates, while require much more time. So situations are possible when one thread is updating on-disk metadata and another one is waiting for the activemap lock just to update the in-memory map. Improve this by introducing additional, on-disk map lock: when in-memory map is updated and it is detected that the on-disk map needs update too, the on-disk map lock is acquired and the on-memory lock is released before flushing the map. Reported by: Yamagi Burmeister yamagi.org Tested by: Yamagi Burmeister yamagi.org Reviewed by: pjd r255717: Fix comments. Modified: stable/9/sbin/hastd/hast.h stable/9/sbin/hastd/primary.c stable/9/sbin/hastd/secondary.c Directory Properties: stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastd/hast.h ============================================================================== --- stable/9/sbin/hastd/hast.h Thu Oct 3 18:50:09 2013 (r256026) +++ stable/9/sbin/hastd/hast.h Thu Oct 3 18:52:04 2013 (r256027) @@ -226,8 +226,10 @@ struct hast_resource { /* Activemap structure. */ struct activemap *hr_amp; - /* Locked used to synchronize access to hr_amp. */ + /* Lock used to synchronize access to hr_amp. */ pthread_mutex_t hr_amp_lock; + /* Lock used to synchronize access to hr_amp diskmap. */ + pthread_mutex_t hr_amp_diskmap_lock; /* Number of BIO_READ requests. */ uint64_t hr_stat_read; Modified: stable/9/sbin/hastd/primary.c ============================================================================== --- stable/9/sbin/hastd/primary.c Thu Oct 3 18:50:09 2013 (r256026) +++ stable/9/sbin/hastd/primary.c Thu Oct 3 18:52:04 2013 (r256027) @@ -172,7 +172,7 @@ static pthread_mutex_t metadata_lock; hio_next[(ncomp)]); \ mtx_unlock(&hio_##name##_list_lock[ncomp]); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond[(ncomp)]); \ + cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \ } while (0) #define QUEUE_INSERT2(hio, name) do { \ bool _wakeup; \ @@ -182,7 +182,7 @@ static pthread_mutex_t metadata_lock; TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_##name##_next);\ mtx_unlock(&hio_##name##_list_lock); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond); \ + cv_broadcast(&hio_##name##_list_cond); \ } while (0) #define QUEUE_TAKE1(hio, name, ncomp, timeout) do { \ bool _last; \ @@ -291,22 +291,28 @@ primary_exitx(int exitcode, const char * exit(exitcode); } +/* Expects res->hr_amp locked, returns unlocked. */ static int hast_activemap_flush(struct hast_resource *res) { const unsigned char *buf; size_t size; + int ret; + mtx_lock(&res->hr_amp_diskmap_lock); buf = activemap_bitmap(res->hr_amp, &size); + mtx_unlock(&res->hr_amp_lock); PJDLOG_ASSERT(buf != NULL); PJDLOG_ASSERT((size % res->hr_local_sectorsize) == 0); + ret = 0; if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) != (ssize_t)size) { pjdlog_errno(LOG_ERR, "Unable to flush activemap to disk"); res->hr_stat_activemap_write_error++; - return (-1); + ret = -1; } - if (res->hr_metaflush == 1 && g_flush(res->hr_localfd) == -1) { + if (ret == 0 && res->hr_metaflush == 1 && + g_flush(res->hr_localfd) == -1) { if (errno == EOPNOTSUPP) { pjdlog_warning("The %s provider doesn't support flushing write cache. Disabling it.", res->hr_localpath); @@ -315,10 +321,11 @@ hast_activemap_flush(struct hast_resourc pjdlog_errno(LOG_ERR, "Unable to flush disk cache on activemap update"); res->hr_stat_activemap_flush_error++; - return (-1); + ret = -1; } } - return (0); + mtx_unlock(&res->hr_amp_diskmap_lock); + return (ret); } static bool @@ -783,6 +790,7 @@ init_remote(struct hast_resource *res, s * Now that we merged bitmaps from both nodes, flush it to the * disk before we start to synchronize. */ + mtx_lock(&res->hr_amp_lock); (void)hast_activemap_flush(res); } nv_free(nvin); @@ -1288,8 +1296,9 @@ ggate_recv_thread(void *arg) ggio->gctl_offset, ggio->gctl_length)) { res->hr_stat_activemap_update++; (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); break; case BIO_DELETE: res->hr_stat_delete++; @@ -1649,8 +1658,9 @@ done_queue: if (activemap_need_sync(res->hr_amp, ggio->gctl_offset, ggio->gctl_length)) { (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) (void)refcnt_release(&hio->hio_countdown); } @@ -1917,8 +1927,9 @@ ggate_send_thread(void *arg) ggio->gctl_offset, ggio->gctl_length)) { res->hr_stat_activemap_update++; (void)hast_activemap_flush(res); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); } if (ggio->gctl_cmd == BIO_WRITE) { /* @@ -2014,8 +2025,11 @@ sync_thread(void *arg __unused) */ if (activemap_extent_complete(res->hr_amp, syncext)) (void)hast_activemap_flush(res); + else + mtx_unlock(&res->hr_amp_lock); + } else { + mtx_unlock(&res->hr_amp_lock); } - mtx_unlock(&res->hr_amp_lock); if (dorewind) { dorewind = false; if (offset == -1) Modified: stable/9/sbin/hastd/secondary.c ============================================================================== --- stable/9/sbin/hastd/secondary.c Thu Oct 3 18:50:09 2013 (r256026) +++ stable/9/sbin/hastd/secondary.c Thu Oct 3 18:52:04 2013 (r256027) @@ -85,14 +85,13 @@ static TAILQ_HEAD(, hio) hio_free_list; static pthread_mutex_t hio_free_list_lock; static pthread_cond_t hio_free_list_cond; /* - * Disk thread (the one that do I/O requests) takes requests from this list. + * Disk thread (the one that does I/O requests) takes requests from this list. */ static TAILQ_HEAD(, hio) hio_disk_list; static pthread_mutex_t hio_disk_list_lock; static pthread_cond_t hio_disk_list_cond; /* - * There is one recv list for every component, although local components don't - * use recv lists as local requests are done synchronously. + * Thread that sends requests back to primary takes requests from this list. */ static TAILQ_HEAD(, hio) hio_send_list; static pthread_mutex_t hio_send_list_lock; @@ -115,7 +114,7 @@ static void *send_thread(void *arg); TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_next); \ mtx_unlock(&hio_##name##_list_lock); \ if (_wakeup) \ - cv_signal(&hio_##name##_list_cond); \ + cv_broadcast(&hio_##name##_list_cond); \ } while (0) #define QUEUE_TAKE(name, hio) do { \ mtx_lock(&hio_##name##_list_lock); \ From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 3 23:52:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 18D35E9; Thu, 3 Oct 2013 23:52:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0486D28E2; Thu, 3 Oct 2013 23:52:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93Nq2k0014940; Thu, 3 Oct 2013 23:52:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93Nq2v2014939; Thu, 3 Oct 2013 23:52:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201310032352.r93Nq2v2014939@svn.freebsd.org> From: Xin LI Date: Thu, 3 Oct 2013 23:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256033 - stable/9/sys/dev/arcmsr X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 23:52:03 -0000 Author: delphij Date: Thu Oct 3 23:52:02 2013 New Revision: 256033 URL: http://svnweb.freebsd.org/changeset/base/256033 Log: MFC r255718: Update arcmsr(4) driver to 1.20.00.28 which fixes mutex recursion in CCB abort codepath. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/9/sys/dev/arcmsr/arcmsr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.c Thu Oct 3 22:52:03 2013 (r256032) +++ stable/9/sys/dev/arcmsr/arcmsr.c Thu Oct 3 23:52:02 2013 (r256033) @@ -74,6 +74,7 @@ ** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter ** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 ** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 +** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs ****************************************************************************************** */ @@ -145,7 +146,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.27 2013-05-06" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.28 2013-09-13" #include /* ************************************************************************** @@ -1622,7 +1623,6 @@ static void arcmsr_abort_dr_ccbs(struct u_int32_t intmask_org; int i; - ARCMSR_LOCK_ACQUIRE(&acb->isr_lock); /* disable all outbound interrupts */ intmask_org = arcmsr_disable_allintr(acb); for (i = 0; i < ARCMSR_MAX_FREESRB_NUM; i++) @@ -1641,7 +1641,6 @@ static void arcmsr_abort_dr_ccbs(struct } /* enable outbound Post Queue, outbound doorbell Interrupt */ arcmsr_enable_allintr(acb, intmask_org); - ARCMSR_LOCK_RELEASE(&acb->isr_lock); } /* ************************************************************************** @@ -3425,8 +3424,7 @@ static void arcmsr_get_hba_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ @@ -3475,8 +3473,7 @@ static void arcmsr_get_hbb_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ @@ -3526,8 +3523,7 @@ static void arcmsr_get_hbc_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ @@ -3578,8 +3574,7 @@ static void arcmsr_get_hbd_config(struct acb_device_map++; i++; } - printf("ARECA RAID ADAPTER%d: %s \n", acb->pci_unit, ARCMSR_DRIVER_VERSION); - printf("ARECA RAID ADAPTER%d: FIRMWARE VERSION %s \n", acb->pci_unit, acb->firm_version); + printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version); acb->firm_request_len = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_request_len, 1, 04-07*/ acb->firm_numbers_queue = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_numbers_queue, 2, 08-11*/ acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_sdram_size, 3, 12-15*/ @@ -4264,6 +4259,8 @@ static int arcmsr_attach(device_t dev) return (ENOMEM); } arcmsr_mutex_init(acb); + acb->pci_dev = dev; + acb->pci_unit = unit; if(arcmsr_initialize(dev)) { printf("arcmsr%d: initialize failure!\n", unit); arcmsr_mutex_destroy(acb); @@ -4284,8 +4281,6 @@ static int arcmsr_attach(device_t dev) return ENXIO; } acb->irqres = irqres; - acb->pci_dev = dev; - acb->pci_unit = unit; /* * Now let the CAM generic SCSI layer find the SCSI devices on * the bus * start queue to reset to the idle loop. * @@ -4367,7 +4362,7 @@ static int arcmsr_probe(device_t dev) { u_int32_t id; static char buf[256]; - char x_type[]={"X-TYPE"}; + char x_type[]={"unknown"}; char *type; int raid6 = 1; @@ -4413,11 +4408,13 @@ static int arcmsr_probe(device_t dev) break; default: type = x_type; + raid6 = 0; break; } if(type == x_type) return(ENXIO); - sprintf(buf, "Areca %s Host Adapter RAID Controller %s\n", type, raid6 ? "(RAID6 capable)" : ""); + sprintf(buf, "Areca %s Host Adapter RAID Controller %s\n%s\n", + type, raid6 ? "(RAID6 capable)" : "", ARCMSR_DRIVER_VERSION); device_set_desc_copy(dev, buf); return 0; } From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 4 17:52:57 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AACFB70A; Fri, 4 Oct 2013 17:52:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 971182C98; Fri, 4 Oct 2013 17:52:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94HqvqR041321; Fri, 4 Oct 2013 17:52:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94HqvGA041313; Fri, 4 Oct 2013 17:52:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201310041752.r94HqvGA041313@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 4 Oct 2013 17:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256054 - stable/9/bin/pkill X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 17:52:57 -0000 Author: trasz Date: Fri Oct 4 17:52:56 2013 New Revision: 256054 URL: http://svnweb.freebsd.org/changeset/base/256054 Log: MFC r254134: Add -c flag to pgrep(1) and pkill(1), to match login classes. Modified: stable/9/bin/pkill/pkill.1 stable/9/bin/pkill/pkill.c Directory Properties: stable/9/bin/pkill/ (props changed) Modified: stable/9/bin/pkill/pkill.1 ============================================================================== --- stable/9/bin/pkill/pkill.1 Fri Oct 4 17:21:01 2013 (r256053) +++ stable/9/bin/pkill/pkill.1 Fri Oct 4 17:52:56 2013 (r256054) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 11, 2010 +.Dd August 9, 2013 .Dt PKILL 1 .Os .Sh NAME @@ -44,6 +44,7 @@ .Op Fl N Ar system .Op Fl P Ar ppid .Op Fl U Ar uid +.Op Fl c Ar class .Op Fl d Ar delim .Op Fl g Ar pgrp .Op Fl j Ar jid @@ -60,6 +61,7 @@ .Op Fl N Ar system .Op Fl P Ar ppid .Op Fl U Ar uid +.Op Fl c Ar class .Op Fl g Ar pgrp .Op Fl j Ar jid .Op Fl s Ar sid @@ -130,6 +132,9 @@ or process and all of its ancestors are excluded (unless .Fl v is used). +.It Fl c Ar class +Restrict matches to processes running with specified login class +.Ar class . .It Fl f Match against full argument lists. The default is to match against process names. Modified: stable/9/bin/pkill/pkill.c ============================================================================== --- stable/9/bin/pkill/pkill.c Fri Oct 4 17:21:01 2013 (r256053) +++ stable/9/bin/pkill/pkill.c Fri Oct 4 17:52:56 2013 (r256054) @@ -79,12 +79,14 @@ enum listtype { LT_TTY, LT_PGRP, LT_JID, - LT_SID + LT_SID, + LT_CLASS }; struct list { SLIST_ENTRY(list) li_chain; long li_number; + char *li_name; }; SLIST_HEAD(listhead, list); @@ -116,6 +118,7 @@ static struct listhead ppidlist = SLIST_ static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(tdevlist); static struct listhead sidlist = SLIST_HEAD_INITIALIZER(sidlist); static struct listhead jidlist = SLIST_HEAD_INITIALIZER(jidlist); +static struct listhead classlist = SLIST_HEAD_INITIALIZER(classlist); static void usage(void) __attribute__((__noreturn__)); static int killact(const struct kinfo_proc *); @@ -179,7 +182,7 @@ main(int argc, char **argv) execf = NULL; coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ac:d:fg:ij:lnoqs:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -222,6 +225,10 @@ main(int argc, char **argv) case 'a': ancestors++; break; + case 'c': + makelist(&classlist, LT_CLASS, optarg); + criteria = 1; + break; case 'd': if (!pgrep) usage(); @@ -469,6 +476,20 @@ main(int argc, char **argv) continue; } + SLIST_FOREACH(li, &classlist, li_chain) { + /* + * We skip P_SYSTEM processes to match ps(1) output. + */ + if ((kp->ki_flag & P_SYSTEM) == 0 && + kp->ki_loginclass != NULL && + strcmp(kp->ki_loginclass, li->li_name) == 0) + break; + } + if (SLIST_FIRST(&classlist) != NULL && li == NULL) { + selected[i] = 0; + continue; + } + if (argc == 0) selected[i] = 1; } @@ -562,9 +583,9 @@ usage(void) fprintf(stderr, "usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n" - " [-P ppid] [-U uid] [-g pgrp] [-j jid] [-s sid]\n" - " [-t tty] [-u euid] pattern ...\n", getprogname(), - ustr); + " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j jid]\n" + " [-s sid] [-t tty] [-u euid] pattern ...\n", + getprogname(), ustr); exit(STATUS_BADUSAGE); } @@ -664,8 +685,10 @@ makelist(struct listhead *head, enum lis SLIST_INSERT_HEAD(head, li, li_chain); empty = 0; - li->li_number = (uid_t)strtol(sp, &ep, 0); - if (*ep == '\0') { + if (type != LT_CLASS) + li->li_number = (uid_t)strtol(sp, &ep, 0); + + if (type != LT_CLASS && *ep == '\0') { switch (type) { case LT_PGRP: if (li->li_number == 0) @@ -750,6 +773,12 @@ foundtty: if ((st.st_mode & S_IFCHR) == errx(STATUS_BADUSAGE, "Invalid jail ID `%s'", sp); break; + case LT_CLASS: + li->li_number = -1; + li->li_name = strdup(sp); + if (li->li_name == NULL) + err(STATUS_ERROR, "Cannot allocate memory"); + break; default: usage(); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Oct 4 19:57:47 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 984B3D97; Fri, 4 Oct 2013 19:57:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 849CC237C; Fri, 4 Oct 2013 19:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r94JvlBN023037; Fri, 4 Oct 2013 19:57:47 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r94JvlAW023036; Fri, 4 Oct 2013 19:57:47 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310041957.r94JvlAW023036@svn.freebsd.org> From: Dimitry Andric Date: Fri, 4 Oct 2013 19:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r256059 - stable/9/contrib/llvm/lib/Target/X86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 19:57:47 -0000 Author: dim Date: Fri Oct 4 19:57:47 2013 New Revision: 256059 URL: http://svnweb.freebsd.org/changeset/base/256059 Log: MFC r255978: Pull in r191711 from upstream llvm trunk: The X86FixupLEAs pass for Intel Atom must not call convertToThreeAddress on ADD16rr opcodes, if src1 != src, since that would cause convertToThreeAddress to try to create a virtual register. This is not permitted after register allocation, which is when the X86FixupLEAs pass runs. This patch fixes PR16785. Pull in r191715 from upstream llvm trunk: Forgot to add a break statement. This should enable building the x11-toolskits/libXaw port with CPUTYPE=atom. Reported by: Kenta Suzumoto Modified: stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Fri Oct 4 19:31:41 2013 (r256058) +++ stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp Fri Oct 4 19:57:47 2013 (r256059) @@ -125,6 +125,15 @@ FixupLEAPass::postRAConvertToLEA(Machine // which requires isImm() to be true return 0; } + break; + case X86::ADD16rr: + case X86::ADD16rr_DB: + if (MI->getOperand(1).getReg() != MI->getOperand(2).getReg()) { + // if src1 != src2, then convertToThreeAddress will + // need to create a Virtual register, which we cannot do + // after register allocation. + return 0; + } } return TII->convertToThreeAddress(MFI, MBBI, 0); }