From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 02:16:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63BDF1065705; Sun, 19 Aug 2012 02:16:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E88C8FC12; Sun, 19 Aug 2012 02:16:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J2GNVq012943; Sun, 19 Aug 2012 02:16:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J2GNq8012941; Sun, 19 Aug 2012 02:16:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208190216.q7J2GNq8012941@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 Aug 2012 02:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239380 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 02:16:23 -0000 Author: adrian Date: Sun Aug 19 02:16:22 2012 New Revision: 239380 URL: http://svn.freebsd.org/changeset/base/239380 Log: When assembling the descriptor list, make sure that the "first" descriptor is marked correctly. The existing logic assumed that the first descriptor is i == 0, which doesn't hold for EDMA TX. In this instance, the first time filltxdesc() is called can be up to i == 3. So for a two-buffer descriptor: * firstSeg is set to 0; * lastSeg is set to 1; * the ath_hal_filltxdesc() code will treat it as the last segment in a descriptor chain and blank some of the descriptor fields, causing the TX to stop. When firstSeg is set to 1 (regardless of lastSeg), it overrides the lastSeg setting. Thus, ath_hal_filltxdesc() won't blank out these fields. Tested: AR9380, STA mode. With this, association is successful. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Aug 18 23:28:34 2012 (r239379) +++ head/sys/dev/ath/if_ath_tx.c Sun Aug 19 02:16:22 2012 (r239380) @@ -306,6 +306,7 @@ ath_tx_chaindesclist(struct ath_softc *s HAL_DMA_ADDR bufAddrList[4]; uint32_t segLenList[4]; int numTxMaps = 1; + int isFirstDesc = 1; /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -369,10 +370,11 @@ ath_tx_chaindesclist(struct ath_softc *s , segLenList , bf->bf_descid /* XXX desc id */ , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ - , i == 0 /* first segment */ + , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ , ds0 /* first descriptor */ ); + isFirstDesc = 0; DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %d: %08x %08x %08x %08x %08x %08x\n", __func__, i, ds->ds_link, ds->ds_data, From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 02:22:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F08C106564A; Sun, 19 Aug 2012 02:22:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F414B8FC0A; Sun, 19 Aug 2012 02:22:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J2MG30013627; Sun, 19 Aug 2012 02:22:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J2MGJU013624; Sun, 19 Aug 2012 02:22:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208190222.q7J2MGJU013624@svn.freebsd.org> From: Adrian Chadd Date: Sun, 19 Aug 2012 02:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239381 - in head/sys/dev/ath: . ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 02:22:17 -0000 Author: adrian Date: Sun Aug 19 02:22:16 2012 New Revision: 239381 URL: http://svn.freebsd.org/changeset/base/239381 Log: Extend the TX descriptor debug printing to be properly aware of EDMA code. * create a new TX EDMA descriptor struct to represent TX EDMA descriptors when doing debugging; * implement an EDMA printing function which: + hardcodes the TX map size to 4 for now; + correctly prints out the number of segments - there's one descriptor for up to 4 buffers (segments), not one for each segment; + print out 4 DS buffer and len pointers; + print out the correct number of DWORDs in the TX descriptor. TODO: * Remove all of the hard-coded stuff. Ew. Modified: head/sys/dev/ath/ath_hal/ah_desc.h head/sys/dev/ath/if_ath_debug.c Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Sun Aug 19 02:16:22 2012 (r239380) +++ head/sys/dev/ath/ath_hal/ah_desc.h Sun Aug 19 02:22:16 2012 (r239381) @@ -223,6 +223,12 @@ struct ath_desc { uint32_t ds_hw[HAL_DESC_HW_SIZE]; /* opaque h/w region */ }; +struct ath_desc_txedma { + uint32_t ds_info; + uint32_t ds_link; + uint32_t ds_hw[21]; /* includes buf/len */ +}; + struct ath_desc_status { union { struct ath_tx_status tx;/* xmit status */ Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Sun Aug 19 02:16:22 2012 (r239380) +++ head/sys/dev/ath/if_ath_debug.c Sun Aug 19 02:22:16 2012 (r239381) @@ -132,8 +132,72 @@ ath_printrxbuf(struct ath_softc *sc, con } } -void -ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf, +static void +ath_printtxbuf_edma(struct ath_softc *sc, const struct ath_buf *first_bf, + u_int qnum, u_int ix, int done) +{ + const struct ath_tx_status *ts = + &first_bf->bf_last->bf_status.ds_txstat; + const struct ath_buf *bf = first_bf; + const char *ds; + const struct ath_desc_txedma *eds; + int i, n; + + /* + * Assume the TX map size is 4 for now and only walk + * the appropriate number of segments. + */ + n = bf->bf_nseg / 4; + if (n == 0) + n = 1; + + printf("Q%u[%3u]", qnum, ix); + while (bf != NULL) { + /* + * XXX For now, assume the txmap size is 4. + */ + for (i = 0, ds = (const char *) bf->bf_desc; + i < n; + i ++, ds += sc->sc_tx_desclen) { + eds = (const struct ath_desc_txedma *) ds; + printf(" (DS.V:%p DS.P:%p) I: %08x L:%08x F:%04x%s\n", + eds, (const struct ath_desc *)bf->bf_daddr + i, + eds->ds_info, eds->ds_link, + bf->bf_state.bfs_txflags, + !done ? "" : (ts->ts_status == 0) ? " *" : " !"); + printf(" (D[0] = %08x(%08x), D[1] = %08x(%08x)\n", + eds->ds_hw[0], eds->ds_hw[1], + eds->ds_hw[2], eds->ds_hw[3]); + printf(" (D[2] = %08x(%08x), D[3] = %08x(%08x)\n", + eds->ds_hw[4], eds->ds_hw[5], + eds->ds_hw[6], eds->ds_hw[7]); + printf(" Seq: %d swtry: %d ADDBAW?: %d DOBAW?: %d\n", + bf->bf_state.bfs_seqno, + bf->bf_state.bfs_retries, + bf->bf_state.bfs_addedbaw, + bf->bf_state.bfs_dobaw); + printf(" %08x %08x %08x %08x %08x %08x\n", + eds->ds_hw[8], eds->ds_hw[9], + eds->ds_hw[10], eds->ds_hw[11], + eds->ds_hw[12], eds->ds_hw[13]); + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + eds->ds_hw[14], eds->ds_hw[15], eds->ds_hw[16], + eds->ds_hw[17], eds->ds_hw[18], eds->ds_hw[19], + eds->ds_hw[20], eds->ds_hw[21]); +#if 0 + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[22],ds->ds_hw[23],ds->ds_hw[24], + ds->ds_hw[25],ds->ds_hw[26],ds->ds_hw[27], + ds->ds_hw[28], ds->ds_hw[29]); +#endif + } + printf(" [end]\n"); + bf = bf->bf_next; + } +} + +static void +ath_printtxbuf_legacy(struct ath_softc *sc, const struct ath_buf *first_bf, u_int qnum, u_int ix, int done) { const struct ath_tx_status *ts = &first_bf->bf_last->bf_status.ds_txstat; @@ -158,8 +222,7 @@ ath_printtxbuf(struct ath_softc *sc, con ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]); - if (ah->ah_magic == 0x20065416 || - ah->ah_magic == 0x19741014) { + if (ah->ah_magic == 0x20065416) { printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9], @@ -175,4 +238,14 @@ ath_printtxbuf(struct ath_softc *sc, con } } +void +ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf, + u_int qnum, u_int ix, int done) +{ + if (sc->sc_ah->ah_magic == 0x19741014) + ath_printtxbuf_edma(sc, first_bf, qnum, ix, done); + else + ath_printtxbuf_legacy(sc, first_bf, qnum, ix, done); +} + #endif /* ATH_DEBUG */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 03:00:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62FAD1065678; Sun, 19 Aug 2012 03:00:53 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id 29A4B8FC15; Sun, 19 Aug 2012 03:00:52 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M8Z0084RF18NH10@smtp3.clear.net.nz>; Sun, 19 Aug 2012 15:00:46 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Sun, 19 Aug 2012 15:00:45 +1200 Date: Sun, 19 Aug 2012 15:00:22 +1200 From: Andrew Turner In-reply-to: <201208121753.q7CHr7VU017178@svn.freebsd.org> To: Hans Petter Selasky Message-id: <20120819150022.3c583fef@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201208121753.q7CHr7VU017178@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 03:00:53 -0000 Hello, This commit causes issues for me on my AT91 board. I get messages similar to the following: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 0 0 5f d1 a0 0 0 1d 0 (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (da0:umass-sim0:0:0:0): Retrying command (da0:umass-sim0:0:0:0): WRITE(10). CDB: 2a 0 0 0 7 e0 0 0 8 0 (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error (da0:umass-sim0:0:0:0): Retrying command Other people are getting similar messages on different ARM cpus. Andrew From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 07:39:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA189106566B; Sun, 19 Aug 2012 07:39:21 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from smtp01-out.isp.tdc.no (smtp01-out.isp.tdc.no [85.19.210.243]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1348FC19; Sun, 19 Aug 2012 07:39:20 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [85.19.79.136]) by smtp01-out.isp.tdc.no (Postfix) with ESMTP id 3X094k5LZsz395; Sun, 19 Aug 2012 09:38:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bitfrost.no From: =?windows-1252?Q?Hans_Petter_Selasky?= To: =?windows-1252?Q?Hans_Petter_Selasky?= , =?windows-1252?Q?Andrew_Turner?= Date: Sun, 19 Aug 2012 09:39:11 +0200 Mime-Version: 1.0 In-Reply-To: <20120819150022.3c583fef@fubar.geek.nz> References: <20120819150022.3c583fef@fubar.geek.nz> X-Priority: 3 (Normal) Message-Id: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "=?windows-1252?Q?svn-src-head=40freebsd.org?=" , "=?windows-1252?Q?svn-src-all=40freebsd.org?=" , "=?windows-1252?Q?src-committers=40freebsd.org?=" Subject: RE: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 07:39:21 -0000 Hi,=0D=0A=0D=0A=A0=0D=0A=0D=0AHave you stepped the versions=3F=0D=0A=0D=0A= =A0=0D=0A=0D=0AAre you sure it is exactly this commit=3F=0D=0A=0D=0A=A0=0D= =0A=0D=0A--HPS=0D=0A-----Original message-----=0D=0AFrom:Andrew Turner =0D=0ASent:Sun 19-08-2012 05:01=0D=0ASubject:Re: svn = commit: r239214 - in head/sys: dev/usb dev/usb/controller sys=0D=0ATo:Han= s Petter Selasky ;=20=0D=0ACC:src-committers@freebs= d.org; svn-src-all@freebsd.org; svn-src-head@freebsd.org;=20=0D=0AHello,=0D= =0A=0D=0AThis commit causes issues for me on my AT91 board. I get message= s=0D=0Asimilar to the following:=0D=0A=0D=0A(da0:umass-sim0:0:0:0): READ(= 10). CDB: 28 0 0 5f d1 a0 0 0 1d 0=20=0D=0A(da0:umass-sim0:0:0:0): CAM st= atus: CCB request completed with an error=0D=0A(da0:umass-sim0:0:0:0): Re= trying command=0D=0A(da0:umass-sim0:0:0:0): WRITE(10). CDB: 2a 0 0 0 7 e0= 0 0 8 0=20=0D=0A(da0:umass-sim0:0:0:0): CAM status: CCB request complete= d with an error=0D=0A(da0:umass-sim0:0:0:0): Retrying command=0D=0A=0D=0A= Other people are getting similar messages on different ARM cpus.=0D=0A=0D= =0AAndrew=0D=0A From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 08:15:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34708106564A; Sun, 19 Aug 2012 08:15:33 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 143238FC08; Sun, 19 Aug 2012 08:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J8FWRt049958; Sun, 19 Aug 2012 08:15:32 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J8FWLi049955; Sun, 19 Aug 2012 08:15:32 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <201208190815.q7J8FWLi049955@svn.freebsd.org> From: Jun Kuriyama Date: Sun, 19 Aug 2012 08:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239382 - in head/etc: defaults rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 08:15:33 -0000 Author: kuriyama Date: Sun Aug 19 08:15:32 2012 New Revision: 239382 URL: http://svn.freebsd.org/changeset/base/239382 Log: - Allow to pass extra parameters for each jails. - To achieve above, convert jail(8) invocation to use new style command line "-c" flag. Reviewed at: freebsd-jail@ Modified: head/etc/defaults/rc.conf head/etc/rc.d/jail Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun Aug 19 02:22:16 2012 (r239381) +++ head/etc/defaults/rc.conf Sun Aug 19 08:15:32 2012 (r239382) @@ -705,6 +705,7 @@ jail_sysvipc_allow="NO" # Allow SystemV #jail_example_mount_enable="NO" # mount/umount jail's fs #jail_example_fstab="" # fstab(5) for mount/umount #jail_example_flags="-l -U root" # flags for jail(8) +#jail_example_parameters="allow.raw_sockets=1" # extra parameters for this jail ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sun Aug 19 02:22:16 2012 (r239381) +++ head/etc/rc.d/jail Sun Aug 19 08:15:32 2012 (r239382) @@ -115,6 +115,8 @@ init_variables() [ -z "${_flags}" ] && _flags="-l -U root" eval _consolelog=\"\${jail_${_j}_consolelog:-${jail_consolelog}}\" [ -z "${_consolelog}" ] && _consolelog="/var/log/jail_${_j}_console.log" + eval _parameters=\"\${jail_${_j}_parameters:-${jail_parameters}}\" + [ -z "${_parameters}" ] && _parameters="" eval _fib=\"\${jail_${_j}_fib:-${jail_fib}}\" # Debugging aid @@ -193,6 +195,7 @@ init_variables() debug "$_j flags: $_flags" debug "$_j consolelog: $_consolelog" + debug "$_j parameters: $_parameters" if [ -z "${_hostname}" ]; then err 3 "$name: No hostname has been defined for ${_j}" @@ -484,9 +487,19 @@ jail_handle_ips_option() esac # Append address to list of addresses for the jail command. - case "${_addrl}" in - "") _addrl="${_addr}" ;; - *) _addrl="${_addrl},${_addr}" ;; + case "${_type}" in + inet) + case "${_addrl}" in + "") _addrl="${_addr}" ;; + *) _addrl="${_addrl},${_addr}" ;; + esac + ;; + inet6) + case "${_addr6l}" in + "") _addr6l="${_addr}" ;; + *) _addr6l="${_addr6l},${_addr}" ;; + esac + ;; esac # Configure interface alias if requested by a given interface @@ -576,6 +589,7 @@ jail_start() continue; fi _addrl="" + _addr6l="" jail_ips "add" if [ -n "${_fib}" ]; then _setfib="setfib -F '${_fib}'" @@ -641,8 +655,8 @@ jail_start() i=$((i + 1)) done - eval ${_setfib} jail -n ${_jail} ${_flags} -i ${_rootdir} ${_hostname} \ - \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ + eval ${_setfib} jail -n ${_jail} ${_flags} -i -c path=${_rootdir} host.hostname=${_hostname} \ + ip4.addr=\"${_addrl}\" ip6.addr=\"${_addr6l}\" ${_parameters} command=${_exec_start} > ${_tmp_jail} 2>&1 \ Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 433FA106566C; Sun, 19 Aug 2012 08:16:14 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3D78FC0A; Sun, 19 Aug 2012 08:16:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J8GEk7050058; Sun, 19 Aug 2012 08:16:14 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J8GD1M050056; Sun, 19 Aug 2012 08:16:13 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201208190816.q7J8GD1M050056@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 19 Aug 2012 08:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239383 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 08:16:14 -0000 Author: trociny Date: Sun Aug 19 08:16:13 2012 New Revision: 239383 URL: http://svn.freebsd.org/changeset/base/239383 Log: In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK. MFC after: 2 weeks Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Aug 19 08:15:32 2012 (r239382) +++ head/sys/netinet6/ip6_output.c Sun Aug 19 08:16:13 2012 (r239383) @@ -1615,18 +1615,22 @@ ip6_ctloutput(struct socket *so, struct break; #define OPTSET(bit) \ do { \ + INP_WLOCK(in6p); \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTSET2292(bit) \ do { \ + INP_WLOCK(in6p); \ in6p->inp_flags |= IN6P_RFC2292; \ if (optval) \ in6p->inp_flags |= (bit); \ else \ in6p->inp_flags &= ~(bit); \ + INP_WUNLOCK(in6p); \ } while (/*CONSTCOND*/ 0) #define OPTBIT(bit) (in6p->inp_flags & (bit) ? 1 : 0) @@ -1880,6 +1884,7 @@ do { \ if (error) break; + INP_WLOCK(in6p); switch (optval) { case IPV6_PORTRANGE_DEFAULT: in6p->inp_flags &= ~(INP_LOWPORT); @@ -1900,6 +1905,7 @@ do { \ error = EINVAL; break; } + INP_WUNLOCK(in6p); break; #ifdef IPSEC From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 08:26:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 092F41065672; Sun, 19 Aug 2012 08:26:56 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp5.clear.net.nz (smtp5.clear.net.nz [203.97.33.68]) by mx1.freebsd.org (Postfix) with ESMTP id C05BD8FC0A; Sun, 19 Aug 2012 08:26:55 +0000 (UTC) Received: from mxin2-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp5.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M8Z00DKXU4O2L10@smtp5.clear.net.nz>; Sun, 19 Aug 2012 20:26:48 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin2.paradise.net.nz with ESMTP; Sun, 19 Aug 2012 20:26:45 +1200 Date: Sun, 19 Aug 2012 20:26:22 +1200 From: Andrew Turner In-reply-to: To: Hans Petter Selasky Message-id: <20120819202622.6db6a8dd@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Pirate: Arrrr References: <20120819150022.3c583fef@fubar.geek.nz> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky Subject: Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 08:26:56 -0000 On Sun, 19 Aug 2012 09:39:11 +0200 Hans Petter Selasky wrote: > Hi, >=20 > =C2=A0 >=20 > Have you stepped the versions? I did a binary search of the commits to find the revision that caused the issue. > Are you sure it is exactly this commit? I built with r239213 and the problem went away, when I built with r239214 it appeared again. Andrew From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 08:35:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56923106566B; Sun, 19 Aug 2012 08:35:31 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 777358FC0A; Sun, 19 Aug 2012 08:35:30 +0000 (UTC) Received: by bkcje9 with SMTP id je9so1973362bkc.13 for ; Sun, 19 Aug 2012 01:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=a1LbZjEwmmHYmr9xg0GGs8Bhxqrwn/QohZtvtNfeDpU=; b=Q19sRlGEu5ghH4z47zBVASP0mB0agktuwqDPBPjYUCz4b2J5ccSIZro5FnDPju0rKZ 80Z4BeRhU8h+Q1/qzzXjhgZ946bGpKmU0niBT2UvGSTJWwmglU7dQ8wOT3ozNf6l6gVO A0Yxm7rfDcPS8opLymzkY9SsDm/4yfsZrwOhSsTW9IW+0Tx9/2aurSJgd6O2KaQ0ZREN bXOhHsfxDZMQc/dsy2lumFjk61wQej0JYPl3Yb08Ci/TCZAOrqtdNePYQrNWAYPBVCeO eEjHjPZEmuX14YfovLQZzNj5FFTGpWWOxLykC+Tn6x6Hm1gN+UKJGJC7BoABVhaussKi 6LEg== Received: by 10.205.117.141 with SMTP id fm13mr3494877bkc.125.1345365329067; Sun, 19 Aug 2012 01:35:29 -0700 (PDT) Received: from localhost ([95.69.175.25]) by mx.google.com with ESMTPS id g6sm4901390bkg.2.2012.08.19.01.35.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Aug 2012 01:35:28 -0700 (PDT) Sender: Mikolaj Golub Date: Sun, 19 Aug 2012 11:35:25 +0300 From: Mikolaj Golub To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120819083346.GA3758@gmail.com> References: <201208190816.q7J8GD1M050056@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201208190816.q7J8GD1M050056@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r239383 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 08:35:31 -0000 On Sun, Aug 19, 2012 at 08:16:13AM +0000, Mikolaj Golub wrote: > Author: trociny > Date: Sun Aug 19 08:16:13 2012 > New Revision: 239383 > URL: http://svn.freebsd.org/changeset/base/239383 > > Log: > In ip6_ctloutput() guard inp_flags modifications with INP_WLOCK. > The issue this commit fixes was reproduced using this simple program: http://people.freebsd.org/~trociny/test_IPPROTO_IPV6.c When two threads modified IPPROTO_IPV6 options simultaneously (each thread a different option but both options are in inp_flags, like IPV6_V6ONLY and IPV6_PORTRANGE) the result could be wrong due to the interference. I think that modification of ip6_pktopts should be guarded with the lock too. I have a patch for this: http://people.freebsd.org/~trociny/ip6_output.c.ip6_pktopts.1.patch Unfortunately, I don't know how to test this. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:17:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E89C0106564A; Sun, 19 Aug 2012 09:17:21 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B99A28FC0C; Sun, 19 Aug 2012 09:17:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9HLON056369; Sun, 19 Aug 2012 09:17:21 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9HL7l056367; Sun, 19 Aug 2012 09:17:21 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190917.q7J9HL7l056367@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239384 - vendor/illumos/dist/tools/ctf/cvt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 09:17:22 -0000 Author: mm Date: Sun Aug 19 09:17:21 2012 New Revision: 239384 URL: http://svn.freebsd.org/changeset/base/239384 Log: Update vendor/illumos to illumos-gate 13754:7231b684c18b References: https://www.illumos.org/issues/2978 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor/illumos/dist/tools/ctf/cvt/dwarf.c Modified: vendor/illumos/dist/tools/ctf/cvt/dwarf.c ============================================================================== --- vendor/illumos/dist/tools/ctf/cvt/dwarf.c Sun Aug 19 08:16:13 2012 (r239383) +++ vendor/illumos/dist/tools/ctf/cvt/dwarf.c Sun Aug 19 09:17:21 2012 (r239384) @@ -1839,21 +1839,53 @@ die_resolve(dwarf_t *dw) } /* - * Any object containing at least one allocatable section of non-0 size is - * taken to be a file which should contain DWARF type information + * 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_Shdr shdr; gelf_getshdr(scn, &shdr); - if ((shdr.sh_flags & SHF_ALLOC) && - (shdr.sh_size != 0)) - return (B_TRUE); + 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); From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:20:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1651A106566C; Sun, 19 Aug 2012 09:20:24 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0F148FC12; Sun, 19 Aug 2012 09:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9KNpm056752; Sun, 19 Aug 2012 09:20:23 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9KNff056718; Sun, 19 Aug 2012 09:20:23 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190920.q7J9KNff056718@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239385 - in vendor/illumos/dist: cmd/dtrace cmd/dtrace/test/cmd/scripts cmd/dtrace/test/tst/common/aggs cmd/dtrace/test/tst/common/arithmetic cmd/dtrace/test/tst/common/buffering cmd/d... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 09:20:24 -0000 Author: mm Date: Sun Aug 19 09:20:22 2012 New Revision: 239385 URL: http://svn.freebsd.org/changeset/base/239385 Log: Update vendor/illumos to illumos-gate 13758:23432da34147 (dtrace changes) References: 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/3026 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/ vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.baddif.d vendor/illumos/dist/cmd/dtrace/test/tst/common/env/ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh.out (contents, props changed) vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.dyn.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.xlate.d vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.xlate.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/printf/tst.signs.d vendor/illumos/dist/cmd/dtrace/test/tst/common/printf/tst.signs.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/tst.dyn.d vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out vendor/illumos/dist/lib/libdtrace/common/dt_pq.c Deleted: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d vendor/illumos/dist/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/trace/err.D_TRACE_DYN.bad.d vendor/illumos/dist/cmd/dtrace/test/tst/common/tracemem/err.D_PROTO_LEN.toomany.d vendor/illumos/dist/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d Modified: vendor/illumos/dist/cmd/dtrace/dtrace.c vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.fill1.d vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.ring3.d vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh vendor/illumos/dist/cmd/dtrace/test/tst/common/printf/tst.ints.d.out vendor/illumos/dist/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d vendor/illumos/dist/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d vendor/illumos/dist/lib/libdtrace/common/dt_aggregate.c vendor/illumos/dist/lib/libdtrace/common/dt_cc.c vendor/illumos/dist/lib/libdtrace/common/dt_cg.c vendor/illumos/dist/lib/libdtrace/common/dt_consume.c vendor/illumos/dist/lib/libdtrace/common/dt_dis.c vendor/illumos/dist/lib/libdtrace/common/dt_error.c vendor/illumos/dist/lib/libdtrace/common/dt_errtags.h vendor/illumos/dist/lib/libdtrace/common/dt_impl.h vendor/illumos/dist/lib/libdtrace/common/dt_open.c vendor/illumos/dist/lib/libdtrace/common/dt_options.c vendor/illumos/dist/lib/libdtrace/common/dt_parser.c vendor/illumos/dist/lib/libdtrace/common/dt_printf.c vendor/illumos/dist/lib/libdtrace/common/dt_proc.c vendor/illumos/dist/lib/libdtrace/common/dt_proc.h vendor/illumos/dist/lib/libdtrace/common/dt_regset.c vendor/illumos/dist/lib/libdtrace/common/dt_regset.h vendor/illumos/dist/lib/libdtrace/common/dt_subr.c vendor/illumos/dist/lib/libdtrace/i386/dt_isadep.c Modified: vendor/illumos/dist/cmd/dtrace/dtrace.c ============================================================================== --- vendor/illumos/dist/cmd/dtrace/dtrace.c Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/dtrace.c Sun Aug 19 09:20:22 2012 (r239385) @@ -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 @@ -1339,6 +1340,7 @@ main(int argc, char *argv[]) (void) dtrace_setopt(g_dtp, "bufsize", "4m"); (void) dtrace_setopt(g_dtp, "aggsize", "4m"); + (void) dtrace_setopt(g_dtp, "temporal", "yes"); /* * If -G is specified, enable -xlink=dynamic and -xunodefs to permit Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dtest.pl Sun Aug 19 09:20:22 2012 (r239385) @@ -27,6 +27,7 @@ # # Copyright (c) 2011, Joyent, Inc. All rights reserved. +# Copyright (c) 2012 by Delphix. All rights reserved. # require 5.8.4; @@ -612,6 +613,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'; Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d Sun Aug 19 09:20:22 2012 (r239385) @@ -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); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,6 @@ + + 1 0 10 + 2 0 20 + 3 0 30 + 4 0 40 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -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 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d Sun Aug 19 09:20:22 2012 (r239385) @@ -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); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -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 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d Sun Aug 19 09:20:22 2012 (r239385) @@ -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); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1 @@ +cafe Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d Sun Aug 19 09:20:22 2012 (r239385) @@ -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); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out Sun Aug 19 09:20:22 2012 (r239385) @@ -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: vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.fill1.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Sun Aug 19 09:20:22 2012 (r239385) @@ -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 Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.ring3.d ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.ring3.d Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/buffering/tst.ring3.d Sun Aug 19 09:20:22 2012 (r239385) @@ -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. + */ /* * ASSERTION: @@ -37,19 +38,20 @@ */ /* - * We make some regrettable assumptions about the implementation in this test. - * First, we assume that each entry for the printf() of an int takes _exactly_ - * eight bytes (four bytes for the EPID, four bytes for the payload). Second, - * we assume that by allocating storage for n + 1 records, we will get exactly - * n. Here is why: the final predicate that evaluates to false will reserve - * space that it won't use. This act of reservation will advance the wrapped - * offset. That record won't be subsequently used, but the wrapped offset has - * advanced. (And in this case, that old record is clobbered by the exit() - * anyway.) Thirdly: we rely on t_cpu/cpu_id. Finally: we rely on being - * able to run on the CPU that we first ran on. + * We make some regrettable assumptions about the implementation in this + * test. First, we assume that each entry for the printf() of an int + * takes _exactly_ 16 bytes (4 bytes for the EPID, 8 bytes for the + * timestamp, 4 bytes for the payload). Second, we assume that by + * allocating storage for n + 1 records, we will get exactly n. Here is + * why: the final predicate that evaluates to false will reserve space + * that it won't use. This act of reservation will advance the wrapped + * offset. That record won't be subsequently used, but the wrapped + * offset has advanced. (And in this case, that old record is clobbered + * by the exit() anyway.) Thirdly: we rely on t_cpu/cpu_id. Finally: + * we rely on being able to run on the CPU that we first ran on. */ #pragma D option bufpolicy=ring -#pragma D option bufsize=40 +#pragma D option bufsize=80 #pragma D option quiet int n; Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.D_NOREG.noreg.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/* + * Compile some code that requires exactly 9 registers. This should run out + * of registers. + * + * Changes to the code generator might cause this test to succeeed in which + * case the code should be changed to another sequence that exhausts the + * available internal registers. + * + * Note that this and err.baddif.d should be kept in sync. + */ + +BEGIN +{ + a = 4; + trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) * + ((a + a) * (a + a))))))); +} + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.baddif.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/err.baddif.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,44 @@ +/* + * 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. + */ + +/* + * Compile some code that requires exactly 9 registers. This should generate + * invalid DIF because the kernel will flag the fact that we're using more + * registers than are available internally. + * + * Changes to the code generator might cause this test to succeeed in which + * case the code should be changed to another sequence that exhausts the + * available internal registers. + * + * Note that this and err.D_NOREG.noreg.d should be kept in sync. + */ + +#pragma D option iregs=9 + +BEGIN +{ + a = 4; + trace((a + a) * ((a + a) * ((a + a) * ((a + a) * ((a + a) * + ((a + a) * (a + a))))))); +} + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,25 @@ +/* + * 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 setenv=balloon=something_bad_happens + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,25 @@ +/* + * 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 unsetenv=rectalexambot + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,33 @@ +# +# 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 that the LD_NOLAZYLOAD variable is set to 1 as expected. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -c 'printenv LD_NOLAZYLOAD' + +exit $? Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,2 @@ +1 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,33 @@ +# +# 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. +# + +# +# Reset an environment variable we already know to be set. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xsetenv=LD_NOLAZYLOAD=0 -c 'printenv LD_NOLAZYLOAD' + +exit $? Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,2 @@ +0 + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,33 @@ +# +# 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 setting a variable that we isn't already set. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xsetenv=CORPORATIONS=PEOPLE -c 'printenv CORPORATIONS' + +exit $? Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,2 @@ +PEOPLE + Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1,33 @@ +# +# 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 unsetting a variable we know to be set. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xunsetenv=LD_NOLAZYLOAD -c 'printenv LD_NOLAZYLOAD' + +exit $? Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh.out ============================================================================== Binary file. No diff available. Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -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. +# + +# +# Test invalid syntax to the unsetenv option. +# + +if [ $# != 1 ]; then + echo expected one argument: '<'dtrace-path'>' + exit 2 +fi + +dtrace=$1 + +$dtrace -q -Z -n doogle -xunsetenv=ed=screven -c 'true' 2>&1 + +[[ $? -eq 1 ]] && exit 0 + +exit 1 Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh.out Sun Aug 19 09:20:22 2012 (r239385) @@ -0,0 +1 @@ +dtrace: failed to set -x unsetenv: Invalid value for specified option Modified: vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh Sun Aug 19 09:17:21 2012 (r239384) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -24,7 +24,9 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + +# +# Copyright (c) 2012 by Delphix. All rights reserved. # if [ $# != 1 ]; then @@ -49,13 +51,13 @@ tick-1s tick-1s /(i % 2) == 0/ { - system("dtrace -c date -ln 'pid\$target::main:entry' >/dev/null"); + system("dtrace -c date -n 'pid\$target::main:entry' >/dev/null"); } tick-1s /(i % 2) == 1/ { - system("dtrace -c date -ln 'pid\$target::main:return' >/dev/null"); + system("dtrace -c date -n 'pid\$target::main:return' >/dev/null"); } EOF Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d Sun Aug 19 09:20:22 2012 (r239385) @@ -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 +{ + *((int *)alloca(4)) = 1; +} + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d Sun Aug 19 09:20:22 2012 (r239385) @@ -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 +{ + this->a = alloca(4); + *((int *)this->a) = 1; +} + +BEGIN +{ + exit(0); +} Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -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 Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh Sun Aug 19 09:20:22 2012 (r239385) @@ -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 < Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 755D11065672; Sun, 19 Aug 2012 09:21:21 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC828FC1A; Sun, 19 Aug 2012 09:21:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9LL27056880; Sun, 19 Aug 2012 09:21:21 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9LL8v056876; Sun, 19 Aug 2012 09:21:21 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190921.q7J9LL8v056876@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239386 - in vendor-sys/illumos/dist/uts/common: dtrace sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 09:21:21 -0000 Author: mm Date: Sun Aug 19 09:21:20 2012 New Revision: 239386 URL: http://svn.freebsd.org/changeset/base/239386 Log: Update vendor-sys/illumos to illumos-gate 13758:23432da34147 (dtrace) References: 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/3026 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c vendor-sys/illumos/dist/uts/common/sys/dtrace.h vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Sun Aug 19 09:20:22 2012 (r239385) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Sun Aug 19 09:21:20 2012 (r239386) @@ -22,6 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -2401,9 +2402,10 @@ dtrace_speculation_commit(dtrace_state_t { dtrace_speculation_t *spec; dtrace_buffer_t *src, *dest; - uintptr_t daddr, saddr, dlimit; + uintptr_t daddr, saddr, dlimit, slimit; dtrace_speculation_state_t current, new; intptr_t offs; + uint64_t timestamp; if (which == 0) return; @@ -2479,7 +2481,37 @@ dtrace_speculation_commit(dtrace_state_t } /* - * We have the space; copy the buffer across. (Note that this is a + * We have sufficient space to copy the speculative buffer into the + * primary buffer. First, modify the speculative buffer, filling + * in the timestamp of all entries with the current time. The data + * must have the commit() time rather than the time it was traced, + * so that all entries in the primary buffer are in timestamp order. + */ + timestamp = dtrace_gethrtime(); + saddr = (uintptr_t)src->dtb_tomax; + slimit = saddr + src->dtb_offset; + while (saddr < slimit) { + size_t size; + dtrace_rechdr_t *dtrh = (dtrace_rechdr_t *)saddr; + + if (dtrh->dtrh_epid == DTRACE_EPIDNONE) { + saddr += sizeof (dtrace_epid_t); + continue; + } + ASSERT3U(dtrh->dtrh_epid, <=, state->dts_necbs); + size = state->dts_ecbs[dtrh->dtrh_epid - 1]->dte_size; + + ASSERT3U(saddr + size, <=, slimit); + ASSERT3U(size, >=, sizeof (dtrace_rechdr_t)); + ASSERT3U(DTRACE_RECORD_LOAD_TIMESTAMP(dtrh), ==, UINT64_MAX); + + DTRACE_RECORD_STORE_TIMESTAMP(dtrh, timestamp); + + saddr += size; + } + + /* + * Copy the buffer across. (Note that this is a * highly subobtimal bcopy(); in the unlikely event that this becomes * a serious performance issue, a high-performance DTrace-specific * bcopy() should obviously be invented.) @@ -5951,7 +5983,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t a if (now - state->dts_alive > dtrace_deadman_timeout) { /* * We seem to be dead. Unless we (a) have kernel - * destructive permissions (b) have expicitly enabled + * destructive permissions (b) have explicitly enabled * destructive actions and (c) destructive actions have * not been disabled, we're going to transition into * the KILLED state, from which no further processing @@ -5979,8 +6011,18 @@ dtrace_probe(dtrace_id_t id, uintptr_t a tomax = buf->dtb_tomax; ASSERT(tomax != NULL); - if (ecb->dte_size != 0) - DTRACE_STORE(uint32_t, tomax, offs, ecb->dte_epid); + if (ecb->dte_size != 0) { + dtrace_rechdr_t dtrh; + if (!(mstate.dtms_present & DTRACE_MSTATE_TIMESTAMP)) { + mstate.dtms_timestamp = dtrace_gethrtime(); + mstate.dtms_present |= DTRACE_MSTATE_TIMESTAMP; + } + ASSERT3U(ecb->dte_size, >=, sizeof (dtrace_rechdr_t)); + dtrh.dtrh_epid = ecb->dte_epid; + DTRACE_RECORD_STORE_TIMESTAMP(&dtrh, + mstate.dtms_timestamp); + *((dtrace_rechdr_t *)(tomax + offs)) = dtrh; + } mstate.dtms_epid = ecb->dte_epid; mstate.dtms_present |= DTRACE_MSTATE_EPID; @@ -6144,7 +6186,9 @@ dtrace_probe(dtrace_id_t id, uintptr_t a continue; switch (act->dta_kind) { - case DTRACEACT_SPECULATE: + case DTRACEACT_SPECULATE: { + dtrace_rechdr_t *dtrh; + ASSERT(buf == &state->dts_buffer[cpuid]); buf = dtrace_speculation_buffer(state, cpuid, val); @@ -6166,10 +6210,23 @@ dtrace_probe(dtrace_id_t id, uintptr_t a tomax = buf->dtb_tomax; ASSERT(tomax != NULL); - if (ecb->dte_size != 0) - DTRACE_STORE(uint32_t, tomax, offs, - ecb->dte_epid); + if (ecb->dte_size == 0) + continue; + + ASSERT3U(ecb->dte_size, >=, + sizeof (dtrace_rechdr_t)); + dtrh = ((void *)(tomax + offs)); + dtrh->dtrh_epid = ecb->dte_epid; + /* + * When the speculation is committed, all of + * the records in the speculative buffer will + * have their timestamps set to the commit + * time. Until then, it is set to a sentinel + * value, for debugability. + */ + DTRACE_RECORD_STORE_TIMESTAMP(dtrh, UINT64_MAX); continue; + } case DTRACEACT_CHILL: if (dtrace_priv_kernel_destructive(state)) @@ -9369,9 +9426,9 @@ dtrace_ecb_add(dtrace_state_t *state, dt /* * The default size is the size of the default action: recording - * the epid. + * the header. */ - ecb->dte_size = ecb->dte_needed = sizeof (dtrace_epid_t); + ecb->dte_size = ecb->dte_needed = sizeof (dtrace_rechdr_t); ecb->dte_alignment = sizeof (dtrace_epid_t); epid = state->dts_epid++; @@ -9470,122 +9527,89 @@ dtrace_ecb_enable(dtrace_ecb_t *ecb) static void dtrace_ecb_resize(dtrace_ecb_t *ecb) { - uint32_t maxalign = sizeof (dtrace_epid_t); - uint32_t align = sizeof (uint8_t), offs, diff; dtrace_action_t *act; - int wastuple = 0; + uint32_t curneeded = UINT32_MAX; uint32_t aggbase = UINT32_MAX; - dtrace_state_t *state = ecb->dte_state; /* - * If we record anything, we always record the epid. (And we always - * record it first.) + * If we record anything, we always record the dtrace_rechdr_t. (And + * we always record it first.) */ - offs = sizeof (dtrace_epid_t); - ecb->dte_size = ecb->dte_needed = sizeof (dtrace_epid_t); + ecb->dte_size = sizeof (dtrace_rechdr_t); + ecb->dte_alignment = sizeof (dtrace_epid_t); for (act = ecb->dte_action; act != NULL; act = act->dta_next) { dtrace_recdesc_t *rec = &act->dta_rec; + ASSERT(rec->dtrd_size > 0 || rec->dtrd_alignment == 1); - if ((align = rec->dtrd_alignment) > maxalign) - maxalign = align; - - if (!wastuple && act->dta_intuple) { - /* - * This is the first record in a tuple. Align the - * offset to be at offset 4 in an 8-byte aligned - * block. - */ - diff = offs + sizeof (dtrace_aggid_t); - - if (diff = (diff & (sizeof (uint64_t) - 1))) - offs += sizeof (uint64_t) - diff; - - aggbase = offs - sizeof (dtrace_aggid_t); - ASSERT(!(aggbase & (sizeof (uint64_t) - 1))); - } - - /*LINTED*/ - if (rec->dtrd_size != 0 && (diff = (offs & (align - 1)))) { - /* - * The current offset is not properly aligned; align it. - */ - offs += align - diff; - } - - rec->dtrd_offset = offs; - - if (offs + rec->dtrd_size > ecb->dte_needed) { - ecb->dte_needed = offs + rec->dtrd_size; - - if (ecb->dte_needed > state->dts_needed) - state->dts_needed = ecb->dte_needed; - } + ecb->dte_alignment = MAX(ecb->dte_alignment, + rec->dtrd_alignment); if (DTRACEACT_ISAGG(act->dta_kind)) { dtrace_aggregation_t *agg = (dtrace_aggregation_t *)act; - dtrace_action_t *first = agg->dtag_first, *prev; - ASSERT(rec->dtrd_size != 0 && first != NULL); - ASSERT(wastuple); + ASSERT(rec->dtrd_size != 0); + ASSERT(agg->dtag_first != NULL); + ASSERT(act->dta_prev->dta_intuple); ASSERT(aggbase != UINT32_MAX); + ASSERT(curneeded != UINT32_MAX); agg->dtag_base = aggbase; - while ((prev = first->dta_prev) != NULL && - DTRACEACT_ISAGG(prev->dta_kind)) { - agg = (dtrace_aggregation_t *)prev; - first = agg->dtag_first; - } - - if (prev != NULL) { - offs = prev->dta_rec.dtrd_offset + - prev->dta_rec.dtrd_size; - } else { - offs = sizeof (dtrace_epid_t); - } - wastuple = 0; + curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); + rec->dtrd_offset = curneeded; + curneeded += rec->dtrd_size; + ecb->dte_needed = MAX(ecb->dte_needed, curneeded); + + aggbase = UINT32_MAX; + curneeded = UINT32_MAX; + } else if (act->dta_intuple) { + if (curneeded == UINT32_MAX) { + /* + * This is the first record in a tuple. Align + * curneeded to be at offset 4 in an 8-byte + * aligned block. + */ + ASSERT(act->dta_prev == NULL || + !act->dta_prev->dta_intuple); + ASSERT3U(aggbase, ==, UINT32_MAX); + curneeded = P2PHASEUP(ecb->dte_size, + sizeof (uint64_t), sizeof (dtrace_aggid_t)); + + aggbase = curneeded - sizeof (dtrace_aggid_t); + ASSERT(IS_P2ALIGNED(aggbase, + sizeof (uint64_t))); + } + curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); + rec->dtrd_offset = curneeded; + curneeded += rec->dtrd_size; } else { - if (!act->dta_intuple) - ecb->dte_size = offs + rec->dtrd_size; - - offs += rec->dtrd_size; + /* tuples must be followed by an aggregation */ + ASSERT(act->dta_prev == NULL || + !act->dta_prev->dta_intuple); + + ecb->dte_size = P2ROUNDUP(ecb->dte_size, + rec->dtrd_alignment); + rec->dtrd_offset = ecb->dte_size; + ecb->dte_size += rec->dtrd_size; + ecb->dte_needed = MAX(ecb->dte_needed, ecb->dte_size); } - - wastuple = act->dta_intuple; } if ((act = ecb->dte_action) != NULL && !(act->dta_kind == DTRACEACT_SPECULATE && act->dta_next == NULL) && - ecb->dte_size == sizeof (dtrace_epid_t)) { + ecb->dte_size == sizeof (dtrace_rechdr_t)) { /* - * If the size is still sizeof (dtrace_epid_t), then all + * If the size is still sizeof (dtrace_rechdr_t), then all * actions store no data; set the size to 0. */ - ecb->dte_alignment = maxalign; ecb->dte_size = 0; - - /* - * If the needed space is still sizeof (dtrace_epid_t), then - * all actions need no additional space; set the needed - * size to 0. - */ - if (ecb->dte_needed == sizeof (dtrace_epid_t)) - ecb->dte_needed = 0; - - return; } - /* - * Set our alignment, and make sure that the dte_size and dte_needed - * are aligned to the size of an EPID. - */ - ecb->dte_alignment = maxalign; - ecb->dte_size = (ecb->dte_size + (sizeof (dtrace_epid_t) - 1)) & - ~(sizeof (dtrace_epid_t) - 1); - ecb->dte_needed = (ecb->dte_needed + (sizeof (dtrace_epid_t) - 1)) & - ~(sizeof (dtrace_epid_t) - 1); - ASSERT(ecb->dte_size <= ecb->dte_needed); + ecb->dte_size = P2ROUNDUP(ecb->dte_size, sizeof (dtrace_epid_t)); + ecb->dte_needed = P2ROUNDUP(ecb->dte_needed, (sizeof (dtrace_epid_t))); + ecb->dte_state->dts_needed = MAX(ecb->dte_state->dts_needed, + ecb->dte_needed); } static dtrace_action_t * @@ -9955,7 +9979,7 @@ dtrace_ecb_action_add(dtrace_ecb_t *ecb, break; case DTRACEACT_SPECULATE: - if (ecb->dte_size > sizeof (dtrace_epid_t)) + if (ecb->dte_size > sizeof (dtrace_rechdr_t)) return (EINVAL); if (dp == NULL) @@ -10068,7 +10092,7 @@ dtrace_ecb_action_remove(dtrace_ecb_t *e ecb->dte_action = NULL; ecb->dte_action_last = NULL; - ecb->dte_size = sizeof (dtrace_epid_t); + ecb->dte_size = 0; } static void @@ -10339,12 +10363,13 @@ dtrace_buffer_switch(dtrace_buffer_t *bu caddr_t tomax = buf->dtb_tomax; caddr_t xamot = buf->dtb_xamot; dtrace_icookie_t cookie; - hrtime_t now = dtrace_gethrtime(); + hrtime_t now; ASSERT(!(buf->dtb_flags & DTRACEBUF_NOSWITCH)); ASSERT(!(buf->dtb_flags & DTRACEBUF_RING)); cookie = dtrace_interrupt_disable(); + now = dtrace_gethrtime(); buf->dtb_tomax = xamot; buf->dtb_xamot = tomax; buf->dtb_xamot_drops = buf->dtb_drops; @@ -10639,7 +10664,7 @@ dtrace_buffer_reserve(dtrace_buffer_t *b if (epid == DTRACE_EPIDNONE) { size = sizeof (uint32_t); } else { - ASSERT(epid <= state->dts_necbs); + ASSERT3U(epid, <=, state->dts_necbs); ASSERT(state->dts_ecbs[epid - 1] != NULL); size = state->dts_ecbs[epid - 1]->dte_size; @@ -15623,6 +15648,7 @@ dtrace_ioctl(dev_t dev, int cmd, intptr_ desc.dtbd_drops = buf->dtb_drops; desc.dtbd_errors = buf->dtb_errors; desc.dtbd_oldest = buf->dtb_xamot_offset; + desc.dtbd_timestamp = dtrace_gethrtime(); mutex_exit(&dtrace_lock); @@ -15675,6 +15701,7 @@ dtrace_ioctl(dev_t dev, int cmd, intptr_ desc.dtbd_drops = buf->dtb_xamot_drops; desc.dtbd_errors = buf->dtb_xamot_errors; desc.dtbd_oldest = 0; + desc.dtbd_timestamp = buf->dtb_switched; mutex_exit(&dtrace_lock); Modified: vendor-sys/illumos/dist/uts/common/sys/dtrace.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/dtrace.h Sun Aug 19 09:20:22 2012 (r239385) +++ vendor-sys/illumos/dist/uts/common/sys/dtrace.h Sun Aug 19 09:21:20 2012 (r239386) @@ -26,6 +26,7 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DTRACE_H @@ -919,10 +920,10 @@ typedef struct dtrace_ecbdesc { * DTrace Metadata Description Structures * * DTrace separates the trace data stream from the metadata stream. The only - * metadata tokens placed in the data stream are enabled probe identifiers - * (EPIDs) or (in the case of aggregations) aggregation identifiers. In order - * to determine the structure of the data, DTrace consumers pass the token to - * the kernel, and receive in return a corresponding description of the enabled + * metadata tokens placed in the data stream are the dtrace_rechdr_t (EPID + + * timestamp) or (in the case of aggregations) aggregation identifiers. To + * determine the structure of the data, DTrace consumers pass the token to the + * kernel, and receive in return a corresponding description of the enabled * probe (via the dtrace_eprobedesc structure) or the aggregation (via the * dtrace_aggdesc structure). Both of these structures are expressed in terms * of record descriptions (via the dtrace_recdesc structure) that describe the @@ -1017,7 +1018,8 @@ typedef struct dtrace_fmtdesc { #define DTRACEOPT_AGGSORTREV 24 /* reverse-sort aggregations */ #define DTRACEOPT_AGGSORTPOS 25 /* agg. position to sort on */ #define DTRACEOPT_AGGSORTKEYPOS 26 /* agg. key position to sort on */ -#define DTRACEOPT_MAX 27 /* number of options */ +#define DTRACEOPT_TEMPORAL 27 /* temporally ordered output */ +#define DTRACEOPT_MAX 28 /* number of options */ #define DTRACEOPT_UNSET (dtrace_optval_t)-2 /* unset option */ @@ -1037,7 +1039,9 @@ typedef struct dtrace_fmtdesc { * where user-level wishes the kernel to snapshot the buffer to (the * dtbd_data field). The kernel uses the same structure to pass back some * information regarding the buffer: the size of data actually copied out, the - * number of drops, the number of errors, and the offset of the oldest record. + * number of drops, the number of errors, the offset of the oldest record, + * and the time of the snapshot. + * * If the buffer policy is a "switch" policy, taking a snapshot of the * principal buffer has the additional effect of switching the active and * inactive buffers. Taking a snapshot of the aggregation buffer _always_ has @@ -1050,9 +1054,30 @@ typedef struct dtrace_bufdesc { uint64_t dtbd_drops; /* number of drops */ DTRACE_PTR(char, dtbd_data); /* data */ uint64_t dtbd_oldest; /* offset of oldest record */ + uint64_t dtbd_timestamp; /* hrtime of snapshot */ } dtrace_bufdesc_t; /* + * Each record in the buffer (dtbd_data) begins with a header that includes + * the epid and a timestamp. The timestamp is split into two 4-byte parts + * so that we do not require 8-byte alignment. + */ +typedef struct dtrace_rechdr { + dtrace_epid_t dtrh_epid; /* enabled probe id */ + uint32_t dtrh_timestamp_hi; /* high bits of hrtime_t */ + uint32_t dtrh_timestamp_lo; /* low bits of hrtime_t */ +} dtrace_rechdr_t; + +#define DTRACE_RECORD_LOAD_TIMESTAMP(dtrh) \ + ((dtrh)->dtrh_timestamp_lo + \ + ((uint64_t)(dtrh)->dtrh_timestamp_hi << 32)) + +#define DTRACE_RECORD_STORE_TIMESTAMP(dtrh, hrtime) { \ + (dtrh)->dtrh_timestamp_lo = (uint32_t)hrtime; \ + (dtrh)->dtrh_timestamp_hi = hrtime >> 32; \ +} + +/* * DTrace Status * * The status of DTrace is relayed via the dtrace_status structure. This Modified: vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Sun Aug 19 09:20:22 2012 (r239385) +++ vendor-sys/illumos/dist/uts/common/sys/dtrace_impl.h Sun Aug 19 09:21:20 2012 (r239386) @@ -26,6 +26,7 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DTRACE_IMPL_H @@ -199,15 +200,18 @@ typedef struct dtrace_hash { * predicate is non-NULL, the DIF object is executed. If the result is * non-zero, the action list is processed, with each action being executed * accordingly. When the action list has been completely executed, processing - * advances to the next ECB. processing advances to the next ECB. If the - * result is non-zero; For each ECB, it first determines the The ECB - * abstraction allows disjoint consumers to multiplex on single probes. + * advances to the next ECB. The ECB abstraction allows disjoint consumers + * to multiplex on single probes. + * + * Execution of the ECB results in consuming dte_size bytes in the buffer + * to record data. During execution, dte_needed bytes must be available in + * the buffer. This space is used for both recorded data and tuple data. */ struct dtrace_ecb { dtrace_epid_t dte_epid; /* enabled probe ID */ uint32_t dte_alignment; /* required alignment */ - size_t dte_needed; /* bytes needed */ - size_t dte_size; /* total size of payload */ + size_t dte_needed; /* space needed for execution */ + size_t dte_size; /* size of recorded payload */ dtrace_predicate_t *dte_predicate; /* predicate, if any */ dtrace_action_t *dte_action; /* actions, if any */ dtrace_ecb_t *dte_next; /* next ECB on probe */ @@ -265,27 +269,30 @@ typedef struct dtrace_aggregation { * the EPID, the consumer can determine the data layout. (The data buffer * layout is shown schematically below.) By assuring that one can determine * data layout from the EPID, the metadata stream can be separated from the - * data stream -- simplifying the data stream enormously. - * - * base of data buffer ---> +------+--------------------+------+ - * | EPID | data | EPID | - * +------+--------+------+----+------+ - * | data | EPID | data | - * +---------------+------+-----------+ - * | data, cont. | - * +------+--------------------+------+ - * | EPID | data | | - * +------+--------------------+ | - * | || | - * | || | - * | \/ | - * : : - * . . - * . . - * . . - * : : - * | | - * limit of data buffer ---> +----------------------------------+ + * data stream -- simplifying the data stream enormously. The ECB always + * proceeds the recorded data as part of the dtrace_rechdr_t structure that + * includes the EPID and a high-resolution timestamp used for output ordering + * consistency. + * + * base of data buffer ---> +--------+--------------------+--------+ + * | rechdr | data | rechdr | + * +--------+------+--------+----+--------+ + * | data | rechdr | data | + * +---------------+--------+-------------+ + * | data, cont. | + * +--------+--------------------+--------+ + * | rechdr | data | | + * +--------+--------------------+ | + * | || | + * | || | + * | \/ | + * : : + * . . + * . . + * . . + * : : + * | | + * limit of data buffer ---> +--------------------------------------+ * * When evaluating an ECB, dtrace_probe() determines if the ECB's needs of the * principal buffer (both scratch and payload) exceed the available space. If From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:30:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79C17106564A; Sun, 19 Aug 2012 09:30:59 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A86F8FC0A; Sun, 19 Aug 2012 09:30:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9Uxpf057891; Sun, 19 Aug 2012 09:30:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9Uxkp057889; Sun, 19 Aug 2012 09:30:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190930.q7J9Uxkp057889@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239387 - vendor/illumos/dist/man/man1m X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 09:30:59 -0000 Author: mm Date: Sun Aug 19 09:30:58 2012 New Revision: 239387 URL: http://svn.freebsd.org/changeset/base/239387 Log: Update vendor/illumos to illumos-gate 13773:00c2a08cf1bb References: https://www.illumos.org/issues/2399 (zfs manual page) Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Sun Aug 19 09:21:20 2012 (r239386) +++ vendor/illumos/dist/man/man1m/zfs.1m Sun Aug 19 09:30:58 2012 (r239387) @@ -7,7 +7,7 @@ .\" 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] .\" Copyright 2011 Joshua M. Clulow -.TH ZFS 1M "28 Jul 2011" +.TH ZFS 1M "Aug 16, 2012" .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS @@ -219,6 +219,10 @@ zfs \- configures ZFS file systems \fBzfs\fR \fBrelease\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR... .fi +.LP +.nf +\fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR + .SH DESCRIPTION .sp .LP @@ -1758,7 +1762,7 @@ filesystem's oldest or newest snapshot w .sp Multiple snapshots (or ranges of snapshots) of the same filesystem or volume may be specified -in a comma-separated list of snapshots. +in a comma-separated list of snapshots. Only the snapshot's short name (the part after the \fB@\fR) should be specified when using a range or comma-separated list to identify multiple snapshots. @@ -1831,8 +1835,6 @@ options, as they can destroy large porti behavior for mounted file systems in use. .RE -.RE - .sp .ne 2 .na @@ -3057,6 +3059,9 @@ clone subcommand Must als ability in the origin file system create subcommand Must also have the 'mount' ability destroy subcommand Must also have the 'mount' ability +diff subcommand Allows lookup of paths within a dataset + given an object number, and the ability to + create snapshots necessary to 'zfs diff'. mount subcommand Allows mount/umount of ZFS datasets promote subcommand Must also have the 'mount' and 'promote' ability in the origin file system @@ -3267,6 +3272,68 @@ Recursively releases a hold with the giv descendent file systems. .RE +.sp +.ne 2 +.na +\fBzfs diff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR +.ad +.sp .6 +.RS 4n +Display the difference between a snapshot of a given filesystem and another +snapshot of that filesystem from a later time or the current contents of the +filesystem. The first column is a character indicating the type of change, +the other columns indicate pathname, new pathname (in case of rename), change +in link count, and optionally file type and/or change time. + +The types of change are: +.in +2 +.nf +- The path has been removed ++ The path has been created +M The path has been modified +R The path has been renamed +.fi +.in -2 +.sp +.ne 2 +.na +\fB-F\fR +.ad +.sp .6 +.RS 4n +Display an indication of the type of file, in a manner similar to the \fB-F\fR +option of \fBls\fR(1). +.in +2 +.nf +B Block device +C Character device +/ Directory +> Door +| Named pipe +@ Symbolic link +P Event port += Socket +F Regular file +.fi +.in -2 +.RE +.sp +.ne 2 +.na +\fB-H\fR +.ad +.sp .6 +.RS 4n +Give more parseable tab-separated output, without header lines and without arrows. +.RE +.sp +.ne 2 +.na +\fB-t\fR +.ad +.sp .6 +.RS 4n +Display the path's inode change time as the first column of output. .RE .SH EXAMPLES @@ -3650,7 +3717,7 @@ access for system \fBneo\fR on the \fBta .sp .in +2 .nf -# \fB# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR +# \fBzfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR .fi .in -2 .sp @@ -3706,7 +3773,7 @@ The permissions on \fBtank/users\fR are .sp .in +2 .nf -# \fB# zfs allow staff create,mount tank/users\fR +# \fBzfs allow staff create,mount tank/users\fR # \fBzfs allow -c destroy tank/users\fR # \fBzfs allow tank/users\fR ------------------------------------------------------------- @@ -3795,6 +3862,28 @@ Local+Descendent permissions on (tank/us .in -2 .sp +.LP +\fBExample 23\fR Showing the differences between a snapshot and a ZFS Dataset +.sp +.LP +The following example shows how to see what has changed between a prior +snapshot of a ZFS Dataset and its current state. The \fB-F\fR option is used +to indicate type information for the files affected. + +.sp +.in +2 +.nf +# zfs diff -F tank/test@before tank/test +M / /tank/test/ +M F /tank/test/linked (+1) +R F /tank/test/oldname -> /tank/test/newname +- F /tank/test/deleted ++ F /tank/test/created +M F /tank/test/modified +.fi +.in -2 +.sp + .SH EXIT STATUS .sp .LP From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:34:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1765106564A; Sun, 19 Aug 2012 09:34:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 923318FC0A; Sun, 19 Aug 2012 09:34:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9Y48k058292; Sun, 19 Aug 2012 09:34:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9Y4pl058288; Sun, 19 Aug 2012 09:34:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190934.q7J9Y4pl058288@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239388 - in vendor-sys/illumos/dist/uts/common: . fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 09:34:04 -0000 Author: mm Date: Sun Aug 19 09:34:04 2012 New Revision: 239388 URL: http://svn.freebsd.org/changeset/base/239388 Log: Update vendor-sys/illumos/dist to illumos-gate 13772:2579580ac955 References: https://www.illumos.org/issues/3085 (zfs diff panics) Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor-sys/illumos/dist/uts/common/Makefile.files vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c Modified: vendor-sys/illumos/dist/uts/common/Makefile.files ============================================================================== --- vendor-sys/illumos/dist/uts/common/Makefile.files Sun Aug 19 09:30:58 2012 (r239387) +++ vendor-sys/illumos/dist/uts/common/Makefile.files Sun Aug 19 09:34:04 2012 (r239388) @@ -1846,7 +1846,7 @@ IDM_OBJS += $(IDM_SHARED_OBJS) \ VR_OBJS += vr.o -ATGE_OBJS += atge_main.o atge_l1e.o atge_mii.o atge_l1.o +ATGE_OBJS += atge_main.o atge_l1e.o atge_mii.o atge_l1.o atge_l1c.o YGE_OBJS = yge.o @@ -1921,7 +1921,7 @@ IXGBE_OBJS = ixgbe_82598.o ixgbe_8259 ixgbe_buf.o ixgbe_debug.o ixgbe_gld.o \ ixgbe_log.o ixgbe_main.o \ ixgbe_osdep.o ixgbe_rx.o ixgbe_stat.o \ - ixgbe_tx.o + ixgbe_tx.o ixgbe_x540.o ixgbe_mbx.o # # NIU 10G/1G driver module Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:30:58 2012 (r239387) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:34:04 2012 (r239388) @@ -3903,6 +3903,10 @@ dsl_dataset_user_release_sync(void *arg1 VERIFY(error == 0 || error == ENOENT); zapobj = ds->ds_phys->ds_userrefs_obj; VERIFY(0 == zap_remove(mos, zapobj, ra->htag, tx)); + + spa_history_log_internal_ds(ds, "release", tx, + "tag = %s refs now = %lld", ra->htag, (longlong_t)refs); + if (ds->ds_userrefs == 0 && ds->ds_phys->ds_num_children == 1 && DS_IS_DEFER_DESTROY(ds)) { struct dsl_ds_destroyarg dsda = {0}; @@ -3913,9 +3917,6 @@ dsl_dataset_user_release_sync(void *arg1 /* We already did the destroy_check */ dsl_dataset_destroy_sync(&dsda, tag, tx); } - - spa_history_log_internal_ds(ds, "release", tx, - "tag = %s refs now = %lld", ra->htag, (longlong_t)refs); } static int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c Sun Aug 19 09:30:58 2012 (r239387) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c Sun Aug 19 09:34:04 2012 (r239388) @@ -440,8 +440,10 @@ log_internal(nvlist_t *nvl, const char * * If this is part of creating a pool, not everything is * initialized yet, so don't bother logging the internal events. */ - if (tx->tx_txg == TXG_INITIAL) + if (tx->tx_txg == TXG_INITIAL) { + fnvlist_free(nvl); return; + } msg = kmem_alloc(vsnprintf(NULL, 0, fmt, adx) + 1, KM_SLEEP); (void) vsprintf(msg, fmt, adx); From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 09:59:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C86E106566C; Sun, 19 Aug 2012 09:59:42 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4732F8FC14; Sun, 19 Aug 2012 09:59:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7J9xgEL060993; Sun, 19 Aug 2012 09:59:42 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7J9xg4H060991; Sun, 19 Aug 2012 09:59:42 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208190959.q7J9xg4H060991@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 09:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239389 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 09:59:42 -0000 Author: mm Date: Sun Aug 19 09:59:41 2012 New Revision: 239389 URL: http://svn.freebsd.org/changeset/base/239389 Log: Backport fix for vendor issue #3085 3085 zfs diff panics, then panics in a loop on booting References: https://www.illumos.org/issues/3085 PR: kern/170763 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate (r13772) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:34:04 2012 (r239388) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sun Aug 19 09:59:41 2012 (r239389) @@ -3969,6 +3969,11 @@ dsl_dataset_user_release_sync(void *arg1 VERIFY(error == 0 || error == ENOENT); zapobj = ds->ds_phys->ds_userrefs_obj; VERIFY(0 == zap_remove(mos, zapobj, ra->htag, tx)); + + spa_history_log_internal(LOG_DS_USER_RELEASE, + dp->dp_spa, tx, "<%s> %lld dataset = %llu", + ra->htag, (longlong_t)refs, dsobj); + if (ds->ds_userrefs == 0 && ds->ds_phys->ds_num_children == 1 && DS_IS_DEFER_DESTROY(ds)) { struct dsl_ds_destroyarg dsda = {0}; @@ -3979,10 +3984,6 @@ dsl_dataset_user_release_sync(void *arg1 /* We already did the destroy_check */ dsl_dataset_destroy_sync(&dsda, tag, tx); } - - spa_history_log_internal(LOG_DS_USER_RELEASE, - dp->dp_spa, tx, "<%s> %lld dataset = %llu", - ra->htag, (longlong_t)refs, dsobj); } static int From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:31:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB7DF106564A; Sun, 19 Aug 2012 10:31:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90FD88FC14; Sun, 19 Aug 2012 10:31:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAVqLV070169; Sun, 19 Aug 2012 10:31:52 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAVpir070137; Sun, 19 Aug 2012 10:31:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208191031.q7JAVpir070137@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Aug 2012 10:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239390 - in vendor/llvm/dist: . autoconf include/llvm include/llvm/ADT include/llvm/Analysis include/llvm/CodeGen include/llvm/MC include/llvm/Support include/llvm/Target lib/Analysis ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 10:31:52 -0000 Author: dim Date: Sun Aug 19 10:31:50 2012 New Revision: 239390 URL: http://svn.freebsd.org/changeset/base/239390 Log: Vendor import of llvm trunk r162107: http://llvm.org/svn/llvm-project/llvm/trunk@162107 Added: vendor/llvm/dist/include/llvm/MC/MCFixedLenDisassembler.h vendor/llvm/dist/test/CodeGen/Mips/return-vector-float4.ll vendor/llvm/dist/test/CodeGen/X86/2012-08-17-legalizer-crash.ll vendor/llvm/dist/test/CodeGen/X86/pr11334.ll vendor/llvm/dist/test/Transforms/GVN/edge.ll Deleted: vendor/llvm/dist/test/CodeGen/X86/unreachable-stack-protector.ll Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/Makefile vendor/llvm/dist/Makefile.config.in vendor/llvm/dist/autoconf/configure.ac vendor/llvm/dist/configure vendor/llvm/dist/include/llvm/ADT/DenseMap.h vendor/llvm/dist/include/llvm/ADT/VariadicFunction.h vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h vendor/llvm/dist/include/llvm/Analysis/Dominators.h vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/IntrinsicsHexagon.td vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h vendor/llvm/dist/include/llvm/Support/AlignOf.h vendor/llvm/dist/include/llvm/Support/COFF.h vendor/llvm/dist/include/llvm/Support/Compiler.h vendor/llvm/dist/include/llvm/Support/FileSystem.h vendor/llvm/dist/include/llvm/Support/LEB128.h vendor/llvm/dist/include/llvm/Support/NoFolder.h vendor/llvm/dist/include/llvm/Target/Target.td vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp vendor/llvm/dist/lib/Support/APFloat.cpp vendor/llvm/dist/lib/Support/Unix/PathV2.inc vendor/llvm/dist/lib/Support/Windows/PathV2.inc vendor/llvm/dist/lib/Target/ARM/ARMAsmPrinter.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.h vendor/llvm/dist/lib/Target/ARM/ARMFastISel.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstrNEON.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMInstrVFP.td vendor/llvm/dist/lib/Target/ARM/Disassembler/ARMDisassembler.cpp vendor/llvm/dist/lib/Target/Mips/Disassembler/MipsDisassembler.cpp vendor/llvm/dist/lib/Target/Mips/Mips.td vendor/llvm/dist/lib/Target/Mips/MipsCallingConv.td vendor/llvm/dist/lib/Target/Mips/MipsSubtarget.h vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h vendor/llvm/dist/lib/Target/X86/X86InstrFragmentsSIMD.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/CodeGenPrepare.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/VMCore/Dominators.cpp vendor/llvm/dist/lib/VMCore/Verifier.cpp vendor/llvm/dist/test/Analysis/ScalarEvolution/2012-05-29-MulAddRec.ll vendor/llvm/dist/test/CodeGen/ARM/2011-03-15-LdStMultipleBug.ll vendor/llvm/dist/test/CodeGen/ARM/2011-11-29-128bitArithmetics.ll vendor/llvm/dist/test/CodeGen/ARM/fast-isel-call.ll vendor/llvm/dist/test/CodeGen/ARM/fp16.ll vendor/llvm/dist/test/CodeGen/ARM/select.ll vendor/llvm/dist/test/CodeGen/ARM/select_xform.ll vendor/llvm/dist/test/CodeGen/ARM/unaligned_load_store.ll vendor/llvm/dist/test/CodeGen/Generic/donothing.ll vendor/llvm/dist/test/CodeGen/Thumb2/machine-licm.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-select_xform.ll vendor/llvm/dist/test/CodeGen/X86/2011-08-29-InitOrder.ll vendor/llvm/dist/test/CodeGen/X86/fast-isel-x86.ll vendor/llvm/dist/test/CodeGen/X86/full-lsr.ll vendor/llvm/dist/test/CodeGen/X86/memcpy.ll vendor/llvm/dist/test/Instrumentation/AddressSanitizer/basic.ll vendor/llvm/dist/test/Transforms/GVN/rle.ll vendor/llvm/dist/test/Transforms/Inline/always-inline.ll vendor/llvm/dist/test/Transforms/InstCombine/memcpy.ll vendor/llvm/dist/test/Transforms/InstCombine/objsize.ll vendor/llvm/dist/test/Transforms/ObjCARC/basic.ll vendor/llvm/dist/test/Transforms/ObjCARC/invoke.ll vendor/llvm/dist/unittests/ADT/APFloatTest.cpp vendor/llvm/dist/unittests/Support/AlignOfTest.cpp vendor/llvm/dist/unittests/Support/Path.cpp vendor/llvm/dist/utils/TableGen/CodeGenInstruction.cpp vendor/llvm/dist/utils/TableGen/CodeGenInstruction.h vendor/llvm/dist/utils/TableGen/CodeGenRegisters.cpp vendor/llvm/dist/utils/TableGen/CodeGenRegisters.h vendor/llvm/dist/utils/TableGen/FixedLenDecoderEmitter.cpp vendor/llvm/dist/utils/TableGen/InstrInfoEmitter.cpp vendor/llvm/dist/utils/TableGen/RegisterInfoEmitter.cpp vendor/llvm/dist/utils/lit/lit/main.py Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/CMakeLists.txt Sun Aug 19 10:31:50 2012 (r239390) @@ -128,10 +128,15 @@ if( LLVM_TARGETS_TO_BUILD STREQUAL "all" set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} ) endif() +set(LLVM_TARGETS_TO_BUILD + ${LLVM_TARGETS_TO_BUILD} + ${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}) + set(LLVM_ENUM_TARGETS "") foreach(c ${LLVM_TARGETS_TO_BUILD}) list(FIND LLVM_ALL_TARGETS ${c} idx) - if( idx LESS 0 ) + list(FIND LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${c} idy) + if( idx LESS 0 AND idy LESS 0 ) message(FATAL_ERROR "The target `${c}' does not exist. It should be one of\n${LLVM_ALL_TARGETS}") else() @@ -139,11 +144,6 @@ foreach(c ${LLVM_TARGETS_TO_BUILD}) endif() endforeach(c) -set(LLVM_TARGETS_TO_BUILD - ${LLVM_TARGETS_TO_BUILD} - ${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD} - ) - set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm) include(AddLLVMDefinitions) Modified: vendor/llvm/dist/Makefile ============================================================================== --- vendor/llvm/dist/Makefile Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/Makefile Sun Aug 19 10:31:50 2012 (r239390) @@ -244,13 +244,13 @@ build-for-llvm-top: SVN = svn SVN-UPDATE-OPTIONS = AWK = awk -SUB-SVN-DIRS = $(AWK) '/\?\ \ \ \ \ \ / {print $$2}' \ +SUB-SVN-DIRS = $(AWK) '/I|\? / {print $$2}' \ | LC_ALL=C xargs $(SVN) info 2>/dev/null \ | $(AWK) '/^Path:\ / {print $$2}' update: $(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT) - @ $(SVN) status $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update + @ $(SVN) status --no-ignore $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update happiness: update all check-all Modified: vendor/llvm/dist/Makefile.config.in ============================================================================== --- vendor/llvm/dist/Makefile.config.in Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/Makefile.config.in Sun Aug 19 10:31:50 2012 (r239390) @@ -258,6 +258,11 @@ ENABLE_WERROR = @ENABLE_WERROR@ #DEBUG_SYMBOLS = 1 @DEBUG_SYMBOLS@ +# When KEEP_SYMBOLS is enabled, installed executables will never have their +# symbols stripped. +#KEEP_SYMBOLS = 1 +@KEEP_SYMBOLS@ + # The compiler flags to use for optimized builds. OPTIMIZE_OPTION := @OPTIMIZE_OPTION@ Modified: vendor/llvm/dist/autoconf/configure.ac ============================================================================== --- vendor/llvm/dist/autoconf/configure.ac Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/autoconf/configure.ac Sun Aug 19 10:31:50 2012 (r239390) @@ -542,6 +542,15 @@ else AC_SUBST(DEBUG_SYMBOLS,[[DEBUG_SYMBOLS=1]]) fi +dnl --enable-keep-symbols : do not strip installed executables +AC_ARG_ENABLE(keep-symbols, + AS_HELP_STRING(--enable-keep-symbols,[Do not strip installed executables)]),,enableval=no) +if test ${enableval} = "no" ; then + AC_SUBST(KEEP_SYMBOLS,[[]]) +else + AC_SUBST(KEEP_SYMBOLS,[[KEEP_SYMBOLS=1]]) +fi + dnl --enable-jit: check whether they want to enable the jit AC_ARG_ENABLE(jit, AS_HELP_STRING(--enable-jit, Modified: vendor/llvm/dist/configure ============================================================================== --- vendor/llvm/dist/configure Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/configure Sun Aug 19 10:31:50 2012 (r239390) @@ -693,6 +693,7 @@ ENABLE_EXPENSIVE_CHECKS EXPENSIVE_CHECKS DEBUG_RUNTIME DEBUG_SYMBOLS +KEEP_SYMBOLS JIT TARGET_HAS_JIT ENABLE_DOCS @@ -1408,6 +1409,7 @@ Optional Features: NO) --enable-debug-symbols Build compiler with debug symbols (default is NO if optimization is on and YES if it's off) + --enable-keep-symbols Do not strip installed executables) --enable-jit Enable Just In Time Compiling (default is YES) --enable-docs Build documents (default is YES) --enable-doxygen Build doxygen documentation (default is NO) @@ -5158,6 +5160,21 @@ else fi +# Check whether --enable-keep-symbols was given. +if test "${enable_keep_symbols+set}" = set; then + enableval=$enable_keep_symbols; +else + enableval=no +fi + +if test ${enableval} = "no" ; then + KEEP_SYMBOLS= + +else + KEEP_SYMBOLS=KEEP_SYMBOLS=1 + +fi + # Check whether --enable-jit was given. if test "${enable_jit+set}" = set; then enableval=$enable_jit; @@ -10272,7 +10289,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <conf$$subs.sed <<_ACEOF +ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim ENABLE_PIC!$ENABLE_PIC$ac_delim ENABLE_SHARED!$ENABLE_SHARED$ac_delim ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim @@ -22293,7 +22311,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 Modified: vendor/llvm/dist/include/llvm/ADT/DenseMap.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/DenseMap.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/ADT/DenseMap.h Sun Aug 19 10:31:50 2012 (r239390) @@ -687,8 +687,7 @@ class SmallDenseMap /// A "union" of an inline bucket array and the struct representing /// a large bucket. This union will be discriminated by the 'Small' bit. - typename AlignedCharArray::union_type - storage; + AlignedCharArrayUnion storage; public: explicit SmallDenseMap(unsigned NumInitBuckets = 0) { @@ -834,8 +833,7 @@ public: return; // Nothing to do. // First move the inline buckets into a temporary storage. - typename AlignedCharArray::union_type - TmpStorage; + AlignedCharArrayUnion TmpStorage; BucketT *TmpBegin = reinterpret_cast(TmpStorage.buffer); BucketT *TmpEnd = TmpBegin; Modified: vendor/llvm/dist/include/llvm/ADT/VariadicFunction.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/VariadicFunction.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/ADT/VariadicFunction.h Sun Aug 19 10:31:50 2012 (r239390) @@ -206,7 +206,7 @@ struct VariadicFunction2 { ResultT operator()(Param0T P0, Param1T P1, \ LLVM_COMMA_JOIN ## N(const ArgT &A)) const { \ const ArgT *const Args[] = { LLVM_COMMA_JOIN ## N(&A) }; \ - return Func(P0, P1, makeAraryRef(Args)); \ + return Func(P0, P1, makeArrayRef(Args)); \ } LLVM_DEFINE_OVERLOAD(1) LLVM_DEFINE_OVERLOAD(2) Modified: vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h Sun Aug 19 10:31:50 2012 (r239390) @@ -122,6 +122,7 @@ private: bool calcLoopBranchHeuristics(BasicBlock *BB); bool calcZeroHeuristics(BasicBlock *BB); bool calcFloatingPointHeuristics(BasicBlock *BB); + bool calcInvokeHeuristics(BasicBlock *BB); }; } Modified: vendor/llvm/dist/include/llvm/Analysis/Dominators.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/Dominators.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Analysis/Dominators.h Sun Aug 19 10:31:50 2012 (r239390) @@ -705,7 +705,20 @@ DominatorTreeBase::properlyDomina EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase); -class BasicBlockEdge; +class BasicBlockEdge { + const BasicBlock *Start; + const BasicBlock *End; +public: + BasicBlockEdge(const BasicBlock *Start_, const BasicBlock *End_) : + Start(Start_), End(End_) { } + const BasicBlock *getStart() const { + return Start; + } + const BasicBlock *getEnd() const { + return End; + } + bool isSingleEdge() const; +}; //===------------------------------------- /// DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to Modified: vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/CodeGen/MachineInstr.h Sun Aug 19 10:31:50 2012 (r239390) @@ -420,6 +420,12 @@ public: return hasProperty(MCID::Bitcast, Type); } + /// isSelect - Return true if this instruction is a select instruction. + /// + bool isSelect(QueryType Type = IgnoreBundle) const { + return hasProperty(MCID::Select, Type); + } + /// isNotDuplicable - Return true if this instruction cannot be safely /// duplicated. For example, if the instruction has a unique labels attached /// to it, duplicating it would cause multiple definition errors. Modified: vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h Sun Aug 19 10:31:50 2012 (r239390) @@ -146,7 +146,8 @@ public: inline bool isMachineOpcode() const; inline unsigned getMachineOpcode() const; inline const DebugLoc getDebugLoc() const; - + inline void dump() const; + inline void dumpr() const; /// reachesChainWithoutSideEffects - Return true if this operand (which must /// be a chain) reaches the specified operand without crossing any @@ -806,7 +807,12 @@ inline bool SDValue::hasOneUse() const { inline const DebugLoc SDValue::getDebugLoc() const { return Node->getDebugLoc(); } - +inline void SDValue::dump() const { + return Node->dump(); +} +inline void SDValue::dumpr() const { + return Node->dumpr(); +} // Define inline functions from the SDUse class. inline void SDUse::set(const SDValue &V) { Modified: vendor/llvm/dist/include/llvm/IntrinsicsHexagon.td ============================================================================== --- vendor/llvm/dist/include/llvm/IntrinsicsHexagon.td Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/IntrinsicsHexagon.td Sun Aug 19 10:31:50 2012 (r239390) @@ -15,7 +15,7 @@ // // All Hexagon intrinsics start with "llvm.hexagon.". let TargetPrefix = "hexagon" in { - /// Hexagon_Intrinsic - Base class for all altivec intrinsics. + /// Hexagon_Intrinsic - Base class for all Hexagon intrinsics. class Hexagon_Intrinsic ret_types, list param_types, list properties> Added: vendor/llvm/dist/include/llvm/MC/MCFixedLenDisassembler.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/include/llvm/MC/MCFixedLenDisassembler.h Sun Aug 19 10:31:50 2012 (r239390) @@ -0,0 +1,32 @@ +//===-- llvm/MC/MCFixedLenDisassembler.h - Decoder driver -------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// Fixed length disassembler decoder state machine driver. +//===----------------------------------------------------------------------===// +#ifndef MCFIXEDLENDISASSEMBLER_H +#define MCFIXEDLENDISASSEMBLER_H + +namespace llvm { + +namespace MCD { +// Disassembler state machine opcodes. +enum DecoderOps { + OPC_ExtractField = 1, // OPC_ExtractField(uint8_t Start, uint8_t Len) + OPC_FilterValue, // OPC_FilterValue(uleb128 Val, uint16_t NumToSkip) + OPC_CheckField, // OPC_CheckField(uint8_t Start, uint8_t Len, + // uleb128 Val, uint16_t NumToSkip) + OPC_CheckPredicate, // OPC_CheckPredicate(uleb128 PIdx, uint16_t NumToSkip) + OPC_Decode, // OPC_Decode(uleb128 Opcode, uleb128 DIdx) + OPC_SoftFail, // OPC_SoftFail(uleb128 PMask, uleb128 NMask) + OPC_Fail // OPC_Fail() +}; + +} // namespace MCDecode +} // namespace llvm + +#endif Modified: vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h ============================================================================== --- vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h Sun Aug 19 10:31:50 2012 (r239390) @@ -107,6 +107,7 @@ namespace MCID { Compare, MoveImm, Bitcast, + Select, DelaySlot, FoldableAsLoad, MayLoad, @@ -282,6 +283,12 @@ public: return Flags & (1 << MCID::Bitcast); } + /// isSelect - Return true if this is a select instruction. + /// + bool isSelect() const { + return Flags & (1 << MCID::Select); + } + /// isNotDuplicable - Return true if this instruction cannot be safely /// duplicated. For example, if the instruction has a unique labels attached /// to it, duplicating it would cause multiple definition errors. Modified: vendor/llvm/dist/include/llvm/Support/AlignOf.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/AlignOf.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/AlignOf.h Sun Aug 19 10:31:50 2012 (r239390) @@ -107,8 +107,8 @@ LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT // Any larger and MSVC complains. #undef LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT -/// \brief This class template exposes a typedef for type containing a suitable -/// aligned character array to hold elements of any of up to four types. +/// \brief This union template exposes a suitably aligned and sized character +/// array member which can hold elements of any of up to four types. /// /// These types may be arrays, structs, or any other types. The goal is to /// produce a union type containing a character array which, when used, forms @@ -116,7 +116,8 @@ LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT /// than four types can be added at the cost of more boiler plate. template -class AlignedCharArray { +union AlignedCharArrayUnion { +private: class AlignerImpl { T1 t1; T2 t2; T3 t3; T4 t4; @@ -127,6 +128,12 @@ class AlignedCharArray { }; public: + /// \brief The character array buffer for use by clients. + /// + /// No other member of this union should be referenced. The exist purely to + /// constrain the layout of this character array. + char buffer[sizeof(SizerImpl)]; + // Sadly, Clang and GCC both fail to align a character array properly even // with an explicit alignment attribute. To work around this, we union // the character array that will actually be used with a struct that contains @@ -134,16 +141,10 @@ public: // and GCC will properly register the alignment of a struct containing an // aligned member, and this alignment should carry over to the character // array in the union. - union union_type { - // This is the only member of the union which should be used by clients: - char buffer[sizeof(SizerImpl)]; - - // This member of the union only exists to force the alignment. - struct { - typename llvm::AlignedCharArrayImpl::Alignment>::type - nonce_inner_member; - } nonce_member; - }; + struct { + typename llvm::AlignedCharArrayImpl::Alignment>::type + nonce_inner_member; + } nonce_member; }; } // end namespace llvm Modified: vendor/llvm/dist/include/llvm/Support/COFF.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/COFF.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/COFF.h Sun Aug 19 10:31:50 2012 (r239390) @@ -50,7 +50,7 @@ namespace COFF { }; enum MachineTypes { - MT_Invalid = -1, + MT_Invalid = 0xffff, IMAGE_FILE_MACHINE_UNKNOWN = 0x0, IMAGE_FILE_MACHINE_AM33 = 0x13, @@ -142,7 +142,7 @@ namespace COFF { /// Storage class tells where and what the symbol represents enum SymbolStorageClass { - SSC_Invalid = -1, + SSC_Invalid = 0xff, IMAGE_SYM_CLASS_END_OF_FUNCTION = -1, ///< Physical end of function IMAGE_SYM_CLASS_NULL = 0, ///< No symbol @@ -220,7 +220,7 @@ namespace COFF { }; enum SectionCharacteristics { - SC_Invalid = -1, + SC_Invalid = 0xffffffff, IMAGE_SCN_TYPE_NO_PAD = 0x00000008, IMAGE_SCN_CNT_CODE = 0x00000020, Modified: vendor/llvm/dist/include/llvm/Support/Compiler.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/Compiler.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/Compiler.h Sun Aug 19 10:31:50 2012 (r239390) @@ -38,6 +38,25 @@ #define llvm_move(value) (value) #endif +/// LLVM_DELETED_FUNCTION - Expands to = delete if the compiler supports it. +/// Use to mark functions as uncallable. Member functions with this should +/// be declared private so that some behaivor is kept in C++03 mode. +/// +/// class DontCopy { +/// private: +/// DontCopy(const DontCopy&) LLVM_DELETED_FUNCTION; +/// DontCopy &operator =(const DontCopy&) LLVM_DELETED_FUNCTION; +/// public: +/// ... +/// }; +#if (__has_feature(cxx_deleted_functions) \ + || defined(__GXX_EXPERIMENTAL_CXX0X__)) + // No version of MSVC currently supports this. +#define LLVM_DELETED_FUNCTION = delete +#else +#define LLVM_DELETED_FUNCTION +#endif + /// LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked /// into a shared library, then the class should be private to the library and /// not accessible from outside it. Can also be used to mark variables and Modified: vendor/llvm/dist/include/llvm/Support/FileSystem.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/FileSystem.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/FileSystem.h Sun Aug 19 10:31:50 2012 (r239390) @@ -28,6 +28,7 @@ #define LLVM_SUPPORT_FILE_SYSTEM_H #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/DataTypes.h" @@ -576,6 +577,82 @@ error_code FindLibrary(const Twine &shor error_code GetMainExecutable(const char *argv0, void *MainAddr, SmallVectorImpl &result); +/// This class represents a memory mapped file. It is based on +/// boost::iostreams::mapped_file. +class mapped_file_region { + mapped_file_region() LLVM_DELETED_FUNCTION; + mapped_file_region(mapped_file_region&) LLVM_DELETED_FUNCTION; + mapped_file_region &operator =(mapped_file_region&) LLVM_DELETED_FUNCTION; + +public: + enum mapmode { + readonly, //< May only access map via const_data as read only. + readwrite, //< May access map via data and modify it. Written to path. + priv //< May modify via data, but changes are lost on destruction. + }; + +private: + /// Platform specific mapping state. + mapmode Mode; + uint64_t Size; + void *Mapping; +#if LLVM_ON_WIN32 + int FileDescriptor; + void *FileHandle; + void *FileMappingHandle; +#endif + + error_code init(int FD, uint64_t Offset); + +public: + typedef char char_type; + +#if LLVM_USE_RVALUE_REFERENCES + mapped_file_region(mapped_file_region&&); + mapped_file_region &operator =(mapped_file_region&&); +#endif + + /// Construct a mapped_file_region at \a path starting at \a offset of length + /// \a length and with access \a mode. + /// + /// \param path Path to the file to map. If it does not exist it will be + /// created. + /// \param mode How to map the memory. + /// \param length Number of bytes to map in starting at \a offset. If the file + /// is shorter than this, it will be extended. If \a length is + /// 0, the entire file will be mapped. + /// \param offset Byte offset from the beginning of the file where the map + /// should begin. Must be a multiple of + /// mapped_file_region::alignment(). + /// \param ec This is set to errc::success if the map was constructed + /// sucessfully. Otherwise it is set to a platform dependent error. + mapped_file_region(const Twine &path, + mapmode mode, + uint64_t length, + uint64_t offset, + error_code &ec); + + /// \param fd An open file descriptor to map. mapped_file_region takes + /// ownership. It must have been opended in the correct mode. + mapped_file_region(int fd, + mapmode mode, + uint64_t length, + uint64_t offset, + error_code &ec); + + ~mapped_file_region(); + + mapmode flags() const; + uint64_t size() const; + char *data() const; + + /// Get a const view of the data. Modifying this memory has undefined + /// behaivor. + const char *const_data() const; + + /// \returns The minimum alignment offset must be. + static int alignment(); +}; /// @brief Memory maps the contents of a file /// Modified: vendor/llvm/dist/include/llvm/Support/LEB128.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/LEB128.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/LEB128.h Sun Aug 19 10:31:50 2012 (r239390) @@ -19,7 +19,7 @@ namespace llvm { -/// Utility function to encode a SLEB128 value. +/// Utility function to encode a SLEB128 value to an output stream. static inline void encodeSLEB128(int64_t Value, raw_ostream &OS) { bool More; do { @@ -34,7 +34,7 @@ static inline void encodeSLEB128(int64_t } while (More); } -/// Utility function to encode a ULEB128 value. +/// Utility function to encode a ULEB128 value to an output stream. static inline void encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned Padding = 0) { do { @@ -53,6 +53,43 @@ static inline void encodeULEB128(uint64_ } } +/// Utility function to encode a ULEB128 value to a buffer. Returns +/// the length in bytes of the encoded value. +static inline unsigned encodeULEB128(uint64_t Value, uint8_t *p, + unsigned Padding = 0) { + uint8_t *orig_p = p; + do { + uint8_t Byte = Value & 0x7f; + Value >>= 7; + if (Value != 0 || Padding != 0) + Byte |= 0x80; // Mark this byte that that more bytes will follow. + *p++ = Byte; + } while (Value != 0); + + // Pad with 0x80 and emit a null byte at the end. + if (Padding != 0) { + for (; Padding != 1; --Padding) + *p++ = '\x80'; + *p++ = '\x00'; + } + return (unsigned)(p - orig_p); +} + + +/// Utility function to decode a ULEB128 value. +static inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n = 0) { + const uint8_t *orig_p = p; + uint64_t Value = 0; + unsigned Shift = 0; + do { + Value += (*p & 0x7f) << Shift; + Shift += 7; + } while (*p++ >= 128); + if (n) + *n = (unsigned)(p - orig_p); + return Value; +} + } // namespace llvm #endif // LLVM_SYSTEM_LEB128_H Modified: vendor/llvm/dist/include/llvm/Support/NoFolder.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/NoFolder.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Support/NoFolder.h Sun Aug 19 10:31:50 2012 (r239390) @@ -181,6 +181,12 @@ public: ArrayRef IdxList) const { return ConstantExpr::getGetElementPtr(C, IdxList); } + Constant *CreateGetElementPtr(Constant *C, Constant *Idx) const { + // This form of the function only exists to avoid ambiguous overload + // warnings about whether to convert Idx to ArrayRef or + // ArrayRef. + return ConstantExpr::getGetElementPtr(C, Idx); + } Instruction *CreateGetElementPtr(Constant *C, ArrayRef IdxList) const { return GetElementPtrInst::Create(C, IdxList); @@ -190,6 +196,12 @@ public: ArrayRef IdxList) const { return ConstantExpr::getInBoundsGetElementPtr(C, IdxList); } + Constant *CreateInBoundsGetElementPtr(Constant *C, Constant *Idx) const { + // This form of the function only exists to avoid ambiguous overload + // warnings about whether to convert Idx to ArrayRef or + // ArrayRef. + return ConstantExpr::getInBoundsGetElementPtr(C, Idx); + } Instruction *CreateInBoundsGetElementPtr(Constant *C, ArrayRef IdxList) const { return GetElementPtrInst::CreateInBounds(C, IdxList); Modified: vendor/llvm/dist/include/llvm/Target/Target.td ============================================================================== --- vendor/llvm/dist/include/llvm/Target/Target.td Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Target/Target.td Sun Aug 19 10:31:50 2012 (r239390) @@ -28,6 +28,24 @@ class SubRegIndex comp // ComposedOf - A list of two SubRegIndex instances, [A, B]. // This indicates that this SubRegIndex is the result of composing A and B. list ComposedOf = comps; + + // CoveringSubRegIndices - A list of two or more sub-register indexes that + // cover this sub-register. + // + // This field should normally be left blank as TableGen can infer it. + // + // TableGen automatically detects sub-registers that straddle the registers + // in the SubRegs field of a Register definition. For example: + // + // Q0 = dsub_0 -> D0, dsub_1 -> D1 + // Q1 = dsub_0 -> D2, dsub_1 -> D3 + // D1_D2 = dsub_0 -> D1, dsub_1 -> D2 + // QQ0 = qsub_0 -> Q0, qsub_1 -> Q1 + // + // TableGen will infer that D1_D2 is a sub-register of QQ0. It will be given + // the synthetic index dsub_1_dsub_2 unless some SubRegIndex is defined with + // CoveringSubRegIndices = [dsub_1, dsub_2]. + list CoveringSubRegIndices = []; } // RegAltNameIndex - The alternate name set to use for register operands of @@ -321,6 +339,7 @@ class Instruction { bit isCompare = 0; // Is this instruction a comparison instruction? bit isMoveImm = 0; // Is this instruction a move immediate instruction? bit isBitcast = 0; // Is this instruction a bitcast instruction? + bit isSelect = 0; // Is this instruction a select instruction? bit isBarrier = 0; // Can control flow fall through this instruction? bit isCall = 0; // Is this instruction a call instruction? bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand? Modified: vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h ============================================================================== --- vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h Sun Aug 19 10:31:50 2012 (r239390) @@ -413,6 +413,51 @@ public: llvm_unreachable("Target didn't implement TargetInstrInfo::insertSelect!"); } + /// analyzeSelect - Analyze the given select instruction, returning true if + /// it cannot be understood. It is assumed that MI->isSelect() is true. + /// + /// When successful, return the controlling condition and the operands that + /// determine the true and false result values. + /// + /// Result = SELECT Cond, TrueOp, FalseOp + /// + /// Some targets can optimize select instructions, for example by predicating + /// the instruction defining one of the operands. Such targets should set + /// Optimizable. + /// + /// @param MI Select instruction to analyze. + /// @param Cond Condition controlling the select. + /// @param TrueOp Operand number of the value selected when Cond is true. + /// @param FalseOp Operand number of the value selected when Cond is false. + /// @param Optimizable Returned as true if MI is optimizable. + /// @returns False on success. + virtual bool analyzeSelect(const MachineInstr *MI, + SmallVectorImpl &Cond, + unsigned &TrueOp, unsigned &FalseOp, + bool &Optimizable) const { + assert(MI && MI->isSelect() && "MI must be a select instruction"); + return true; + } + + /// optimizeSelect - Given a select instruction that was understood by + /// analyzeSelect and returned Optimizable = true, attempt to optimize MI by + /// merging it with one of its operands. Returns NULL on failure. + /// + /// When successful, returns the new select instruction. The client is + /// responsible for deleting MI. + /// + /// If both sides of the select can be optimized, PreferFalse is used to pick + /// a side. + /// + /// @param MI Optimizable select instruction. + /// @param PreferFalse Try to optimize FalseOp instead of TrueOp. + /// @returns Optimized instruction or NULL. + virtual MachineInstr *optimizeSelect(MachineInstr *MI, + bool PreferFalse = false) const { + // This function must be implemented if Optimizable is ever set. + llvm_unreachable("Target must implement TargetInstrInfo::optimizeSelect!"); + } + /// copyPhysReg - Emit instructions to copy a pair of physical registers. virtual void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, DebugLoc DL, Modified: vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -1,4 +1,4 @@ -//===-- BranchProbabilityInfo.cpp - Branch Probability Analysis -*- C++ -*-===// +//===-- BranchProbabilityInfo.cpp - Branch Probability Analysis -----------===// // // The LLVM Compiler Infrastructure // @@ -78,6 +78,19 @@ static const uint32_t ZH_NONTAKEN_WEIGHT static const uint32_t FPH_TAKEN_WEIGHT = 20; static const uint32_t FPH_NONTAKEN_WEIGHT = 12; +/// \brief Invoke-terminating normal branch taken weight +/// +/// This is the weight for branching to the normal destination of an invoke +/// instruction. We expect this to happen most of the time. Set the weight to an +/// absurdly high value so that nested loops subsume it. +static const uint32_t IH_TAKEN_WEIGHT = 1024 * 1024 - 1; + +/// \brief Invoke-terminating normal branch not-taken weight. +/// +/// This is the weight for branching to the unwind destination of an invoke +/// instruction. This is essentially never taken. +static const uint32_t IH_NONTAKEN_WEIGHT = 1; + // Standard weight value. Used when none of the heuristics set weight for // the edge. static const uint32_t NORMAL_WEIGHT = 16; @@ -371,6 +384,19 @@ bool BranchProbabilityInfo::calcFloating return true; } +bool BranchProbabilityInfo::calcInvokeHeuristics(BasicBlock *BB) { + InvokeInst *II = dyn_cast(BB->getTerminator()); + if (!II) + return false; + + BasicBlock *Normal = II->getNormalDest(); + BasicBlock *Unwind = II->getUnwindDest(); + + setEdgeWeight(BB, Normal, IH_TAKEN_WEIGHT); + setEdgeWeight(BB, Unwind, IH_NONTAKEN_WEIGHT); + return true; +} + void BranchProbabilityInfo::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.setPreservesAll(); @@ -397,7 +423,9 @@ bool BranchProbabilityInfo::runOnFunctio continue; if (calcZeroHeuristics(*I)) continue; - calcFloatingPointHeuristics(*I); + if (calcFloatingPointHeuristics(*I)) + continue; + calcInvokeHeuristics(*I); } PostDominatedByUnreachable.clear(); Modified: vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/Analysis/MemoryBuiltins.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -473,6 +473,10 @@ ObjectSizeOffsetVisitor::visitExtractVal } SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) { + // Ignore self-referencing GEPs, they can occur in unreachable code. + if (&GEP == GEP.getPointerOperand()) + return unknown(); + SizeOffsetType PtrData = compute(GEP.getPointerOperand()); if (!bothKnown(PtrData) || !GEP.hasAllConstantIndices()) return unknown(); Modified: vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -681,10 +681,10 @@ void MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { const MachineInstr *MI = MO->getParent(); const MCInstrDesc &MCID = MI->getDesc(); - const MCOperandInfo &MCOI = MCID.OpInfo[MONum]; // The first MCID.NumDefs operands must be explicit register defines if (MONum < MCID.getNumDefs()) { + const MCOperandInfo &MCOI = MCID.OpInfo[MONum]; if (!MO->isReg()) report("Explicit definition must be a register", MO, MONum); else if (!MO->isDef() && !MCOI.isOptionalDef()) @@ -692,6 +692,7 @@ MachineVerifier::visitMachineOperand(con else if (MO->isImplicit()) report("Explicit definition marked as implicit", MO, MONum); } else if (MONum < MCID.getNumOperands()) { + const MCOperandInfo &MCOI = MCID.OpInfo[MONum]; // Don't check if it's the last operand in a variadic instruction. See, // e.g., LDM_RET in the arm back end. if (MO->isReg() && Modified: vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/CodeGen/PeepholeOptimizer.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -79,6 +79,7 @@ STATISTIC(NumBitcasts, "Number of bitc STATISTIC(NumCmps, "Number of compares eliminated"); STATISTIC(NumImmFold, "Number of move immediate folded"); STATISTIC(NumLoadFold, "Number of loads folded"); +STATISTIC(NumSelects, "Number of selects optimized"); namespace { class PeepholeOptimizer : public MachineFunctionPass { @@ -109,6 +110,7 @@ namespace { bool optimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); bool optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB, SmallPtrSet &LocalMIs); + bool optimizeSelect(MachineInstr *MI); bool isMoveImmediate(MachineInstr *MI, SmallSet &ImmDefRegs, DenseMap &ImmDefMIs); @@ -386,6 +388,23 @@ bool PeepholeOptimizer::optimizeCmpInstr return false; } +/// Optimize a select instruction. +bool PeepholeOptimizer::optimizeSelect(MachineInstr *MI) { + unsigned TrueOp = 0; + unsigned FalseOp = 0; + bool Optimizable = false; + SmallVector Cond; + if (TII->analyzeSelect(MI, Cond, TrueOp, FalseOp, Optimizable)) + return false; + if (!Optimizable) + return false; + if (!TII->optimizeSelect(MI)) + return false; + MI->eraseFromParent(); + ++NumSelects; + return true; +} + /// isLoadFoldable - Check whether MI is a candidate for folding into a later /// instruction. We only fold loads to virtual registers and the virtual /// register defined has a single use. @@ -477,11 +496,11 @@ bool PeepholeOptimizer::runOnMachineFunc ImmDefMIs.clear(); FoldAsLoadDefReg = 0; - bool First = true; - MachineBasicBlock::iterator PMII; for (MachineBasicBlock::iterator MII = I->begin(), MIE = I->end(); MII != MIE; ) { MachineInstr *MI = &*MII; + // We may be erasing MI below, increment MII now. + ++MII; LocalMIs.insert(MI); // If there exists an instruction which belongs to the following @@ -490,28 +509,18 @@ bool PeepholeOptimizer::runOnMachineFunc MI->isKill() || MI->isInlineAsm() || MI->isDebugValue() || MI->hasUnmodeledSideEffects()) { FoldAsLoadDefReg = 0; - ++MII; continue; } if (MI->mayStore() || MI->isCall()) FoldAsLoadDefReg = 0; - if (MI->isBitcast()) { - if (optimizeBitcastInstr(MI, MBB)) { - // MI is deleted. - LocalMIs.erase(MI); - Changed = true; - MII = First ? I->begin() : llvm::next(PMII); - continue; - } - } else if (MI->isCompare()) { - if (optimizeCmpInstr(MI, MBB)) { - // MI is deleted. - LocalMIs.erase(MI); - Changed = true; - MII = First ? I->begin() : llvm::next(PMII); - continue; - } + if ((MI->isBitcast() && optimizeBitcastInstr(MI, MBB)) || + (MI->isCompare() && optimizeCmpInstr(MI, MBB)) || + (MI->isSelect() && optimizeSelect(MI))) { + // MI is deleted. + LocalMIs.erase(MI); + Changed = true; + continue; } if (isMoveImmediate(MI, ImmDefRegs, ImmDefMIs)) { @@ -542,14 +551,9 @@ bool PeepholeOptimizer::runOnMachineFunc // MI is replaced with FoldMI. Changed = true; - PMII = FoldMI; - MII = llvm::next(PMII); continue; } } - First = false; - PMII = MII; - ++MII; } } Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -2303,7 +2303,7 @@ TargetLowering::SimplifySetCC(EVT VT, SD N0.getOpcode() == ISD::AND) if (ConstantSDNode *AndRHS = dyn_cast(N0.getOperand(1))) { - EVT ShiftTy = DCI.isBeforeLegalize() ? + EVT ShiftTy = DCI.isBeforeLegalizeOps() ? getPointerTy() : getShiftAmountTy(N0.getValueType()); if (Cond == ISD::SETNE && C1 == 0) {// (X & 8) != 0 --> (X & 8) >> 3 // Perform the xform if the AND RHS is a single bit. @@ -2333,7 +2333,7 @@ TargetLowering::SimplifySetCC(EVT VT, SD const APInt &AndRHSC = AndRHS->getAPIntValue(); if ((-AndRHSC).isPowerOf2() && (AndRHSC & C1) == C1) { unsigned ShiftBits = AndRHSC.countTrailingZeros(); - EVT ShiftTy = DCI.isBeforeLegalize() ? + EVT ShiftTy = DCI.isBeforeLegalizeOps() ? getPointerTy() : getShiftAmountTy(N0.getValueType()); EVT CmpTy = N0.getValueType(); SDValue Shift = DAG.getNode(ISD::SRL, dl, CmpTy, N0.getOperand(0), @@ -2361,7 +2361,7 @@ TargetLowering::SimplifySetCC(EVT VT, SD } NewC = NewC.lshr(ShiftBits); if (ShiftBits && isLegalICmpImmediate(NewC.getSExtValue())) { - EVT ShiftTy = DCI.isBeforeLegalize() ? + EVT ShiftTy = DCI.isBeforeLegalizeOps() ? getPointerTy() : getShiftAmountTy(N0.getValueType()); EVT CmpTy = N0.getValueType(); SDValue Shift = DAG.getNode(ISD::SRL, dl, CmpTy, N0, Modified: vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp ============================================================================== --- vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -461,6 +461,9 @@ namespace { /// allocateCodeSection - Allocate memory for a code section. uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID) { + // Grow the required block size to account for the block header + Size += sizeof(*CurBlock); + // FIXME: Alignement handling. FreeRangeHeader* candidateBlock = FreeMemoryList; FreeRangeHeader* head = FreeMemoryList; Modified: vendor/llvm/dist/lib/Support/APFloat.cpp ============================================================================== --- vendor/llvm/dist/lib/Support/APFloat.cpp Sun Aug 19 09:59:41 2012 (r239389) +++ vendor/llvm/dist/lib/Support/APFloat.cpp Sun Aug 19 10:31:50 2012 (r239390) @@ -1770,23 +1770,41 @@ APFloat::opStatus APFloat::roundToIntegr opStatus fs; assertArithmeticOK(*semantics); + // If the exponent is large enough, we know that this value is already + // integral, and the arithmetic below would potentially cause it to saturate + // to +/-Inf. Bail out early instead. + if (exponent+1 >= (int)semanticsPrecision(*semantics)) + return opOK; + // The algorithm here is quite simple: we add 2^(p-1), where p is the // precision of our format, and then subtract it back off again. The choice // of rounding modes for the addition/subtraction determines the rounding mode // for our integral rounding as well. - APInt IntegerConstant(NextPowerOf2(semanticsPrecision(*semantics)), - 1 << (semanticsPrecision(*semantics)-1)); + // NOTE: When the input value is negative, we do subtraction followed by + // addition instead. + APInt IntegerConstant(NextPowerOf2(semanticsPrecision(*semantics)), 1); + IntegerConstant <<= semanticsPrecision(*semantics)-1; APFloat MagicConstant(*semantics); fs = MagicConstant.convertFromAPInt(IntegerConstant, false, rmNearestTiesToEven); + MagicConstant.copySign(*this); + if (fs != opOK) return fs; + // Preserve the input sign so that we can handle 0.0/-0.0 cases correctly. + bool inputSign = isNegative(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:32:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D9EE106564A; Sun, 19 Aug 2012 10:32:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EDD38FC14; Sun, 19 Aug 2012 10:32:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAWXnA070268; Sun, 19 Aug 2012 10:32:33 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAWXg3070267; Sun, 19 Aug 2012 10:32:33 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208191032.q7JAWXg3070267@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Aug 2012 10:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239391 - vendor/llvm/llvm-trunk-r162107 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 10:32:33 -0000 Author: dim Date: Sun Aug 19 10:32:32 2012 New Revision: 239391 URL: http://svn.freebsd.org/changeset/base/239391 Log: Tag llvm trunk r162107. Added: vendor/llvm/llvm-trunk-r162107/ - copied from r239390, vendor/llvm/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:33:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13B04106564A; Sun, 19 Aug 2012 10:33:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE3208FC21; Sun, 19 Aug 2012 10:33:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAX5kj070389; Sun, 19 Aug 2012 10:33:05 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAX5KX070368; Sun, 19 Aug 2012 10:33:05 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208191033.q7JAX5KX070368@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Aug 2012 10:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239392 - in vendor/clang/dist: docs docs/analyzer include/clang/AST include/clang/ASTMatchers include/clang/Basic include/clang/Lex include/clang/Parse include/clang/Sema include/clang... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 10:33:06 -0000 Author: dim Date: Sun Aug 19 10:33:04 2012 New Revision: 239392 URL: http://svn.freebsd.org/changeset/base/239392 Log: Vendor import of clang trunk r162107: http://llvm.org/svn/llvm-project/cfe/trunk@162107 Added: vendor/clang/dist/docs/analyzer/ vendor/clang/dist/docs/analyzer/IPA.txt vendor/clang/dist/test/Analysis/inlining/dyn-dispatch-bifurcate.cpp vendor/clang/dist/test/Analysis/reinterpret-cast.cpp vendor/clang/dist/test/CodeGen/align-global-large.c vendor/clang/dist/test/CodeGen/arm-neon-misc.c vendor/clang/dist/test/CodeGen/complex-builtints.c vendor/clang/dist/test/CodeGenOpenCL/vectorLoadStore.cl vendor/clang/dist/test/Index/complete-preamble.cpp vendor/clang/dist/test/Index/complete-preamble.h vendor/clang/dist/test/Sema/arm-asm.c vendor/clang/dist/test/Sema/warn-type-safety-mpi-hdf5.c vendor/clang/dist/test/Sema/warn-type-safety.c vendor/clang/dist/test/Sema/warn-type-safety.cpp vendor/clang/dist/test/SemaObjC/warn-cast-of-sel-expr.m vendor/clang/dist/test/SemaObjCXX/abstract-class-type-ivar.mm Modified: vendor/clang/dist/docs/LanguageExtensions.html vendor/clang/dist/docs/ReleaseNotes.html vendor/clang/dist/include/clang/AST/ASTContext.h vendor/clang/dist/include/clang/AST/Attr.h vendor/clang/dist/include/clang/AST/CommentCommandTraits.h vendor/clang/dist/include/clang/AST/DeclBase.h vendor/clang/dist/include/clang/AST/DeclCXX.h vendor/clang/dist/include/clang/AST/DeclGroup.h vendor/clang/dist/include/clang/AST/DeclLookups.h vendor/clang/dist/include/clang/AST/PrettyPrinter.h vendor/clang/dist/include/clang/AST/RawCommentList.h vendor/clang/dist/include/clang/AST/Stmt.h vendor/clang/dist/include/clang/AST/TemplateBase.h vendor/clang/dist/include/clang/AST/TypeLoc.h vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/Builtins.def vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Lex/PTHManager.h vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/include/clang/Sema/AttributeList.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h vendor/clang/dist/lib/AST/APValue.cpp vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/ASTDiagnostic.cpp vendor/clang/dist/lib/AST/CommentCommandTraits.cpp vendor/clang/dist/lib/AST/DeclCXX.cpp vendor/clang/dist/lib/AST/DeclPrinter.cpp vendor/clang/dist/lib/AST/DeclTemplate.cpp vendor/clang/dist/lib/AST/DumpXML.cpp vendor/clang/dist/lib/AST/NestedNameSpecifier.cpp vendor/clang/dist/lib/AST/RawCommentList.cpp vendor/clang/dist/lib/AST/Stmt.cpp vendor/clang/dist/lib/AST/StmtPrinter.cpp vendor/clang/dist/lib/AST/TemplateBase.cpp vendor/clang/dist/lib/Basic/Diagnostic.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGStmt.cpp vendor/clang/dist/lib/CodeGen/CGValue.h vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Frontend/ASTConsumers.cpp vendor/clang/dist/lib/Frontend/CacheTokens.cpp vendor/clang/dist/lib/Lex/PTHLexer.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseStmt.cpp vendor/clang/dist/lib/Rewrite/RewriteModernObjC.cpp vendor/clang/dist/lib/Rewrite/RewriteObjC.cpp vendor/clang/dist/lib/Sema/AttributeList.cpp vendor/clang/dist/lib/Sema/SemaCast.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExceptionSpec.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprMember.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/AnalysisManager.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/BugReporter.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/CallEvent.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/PathDiagnostic.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ProgramState.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp vendor/clang/dist/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp vendor/clang/dist/test/Analysis/CFNumber.c vendor/clang/dist/test/Analysis/CheckNSError.m vendor/clang/dist/test/Analysis/array-struct.c vendor/clang/dist/test/Analysis/ctor-inlining.mm vendor/clang/dist/test/Analysis/dtor.cpp vendor/clang/dist/test/Analysis/func.c vendor/clang/dist/test/Analysis/html-diags.c vendor/clang/dist/test/Analysis/inline.cpp vendor/clang/dist/test/Analysis/inlining/DynDispatchBifurcate.m vendor/clang/dist/test/Analysis/inlining/InlineObjCClassMethod.m vendor/clang/dist/test/Analysis/keychainAPI.m vendor/clang/dist/test/Analysis/malloc-annotations.c vendor/clang/dist/test/Analysis/malloc.c vendor/clang/dist/test/Analysis/method-call-path-notes.cpp vendor/clang/dist/test/Analysis/method-call.cpp vendor/clang/dist/test/Analysis/misc-ps-region-store.m vendor/clang/dist/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m vendor/clang/dist/test/Analysis/ptr-arith.c vendor/clang/dist/test/Analysis/security-syntax-checks.m vendor/clang/dist/test/Analysis/sizeofpointer.c vendor/clang/dist/test/Analysis/stack-addr-ps.cpp vendor/clang/dist/test/Analysis/stream.c vendor/clang/dist/test/Analysis/variadic-method-types.m vendor/clang/dist/test/CodeCompletion/objc-expr.m vendor/clang/dist/test/CodeGen/alignment.c vendor/clang/dist/test/CodeGen/ms-inline-asm.c vendor/clang/dist/test/CodeGenCXX/devirtualize-virtual-function-calls.cpp vendor/clang/dist/test/CodeGenObjC/instance-method-metadata.m vendor/clang/dist/test/CodeGenObjC/ns_consume_null_check.m vendor/clang/dist/test/Driver/Xlinker-args.c vendor/clang/dist/test/Index/complete-enums.cpp vendor/clang/dist/test/Index/complete-exprs.m vendor/clang/dist/test/Parser/ms-inline-asm.c vendor/clang/dist/test/Sema/128bitint.c vendor/clang/dist/test/Sema/builtins-decl.c vendor/clang/dist/test/Sema/callingconv.c vendor/clang/dist/test/Sema/static-array.c vendor/clang/dist/test/Sema/tentative-decls.c vendor/clang/dist/test/Sema/warn-documentation.cpp vendor/clang/dist/test/SemaCXX/convert-to-bool.cpp vendor/clang/dist/test/SemaCXX/pragma-pack.cpp vendor/clang/dist/test/SemaCXX/references.cpp vendor/clang/dist/test/SemaCXX/uninitialized.cpp vendor/clang/dist/test/SemaCXX/warn-thread-safety-parsing.cpp vendor/clang/dist/test/Tooling/clang-check-ast-dump.cpp vendor/clang/dist/unittests/ASTMatchers/ASTMatchersTest.cpp vendor/clang/dist/unittests/Tooling/RecursiveASTVisitorTest.cpp vendor/clang/dist/utils/TableGen/ClangAttrEmitter.cpp vendor/clang/dist/utils/analyzer/CmpRuns.py vendor/clang/dist/www/comparison.html Modified: vendor/clang/dist/docs/LanguageExtensions.html ============================================================================== --- vendor/clang/dist/docs/LanguageExtensions.html Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/docs/LanguageExtensions.html Sun Aug 19 10:33:04 2012 (r239392) @@ -142,6 +142,13 @@
  • shared_locks_required(...)
  • +
  • Type Safety Checking + +
  • @@ -1913,6 +1920,161 @@ declaration to specify that the function shared locks. Arguments must be lockable type, and there must be at least one argument.

    + +

    Type Safety Checking

    + + +

    Clang supports additional attributes to enable checking type safety +properties that can't be enforced by C type system. Usecases include:

    +
      +
    • MPI library implementations, where these attributes enable checking that + buffer type matches the passed MPI_Datatype;
    • +
    • for HDF5 library there is a similar usecase as MPI;
    • +
    • checking types of variadic functions' arguments for functions like + fcntl() and ioctl().
    • +
    + +

    You can detect support for these attributes with __has_attribute(). For +example:

    + +
    +
    +#if defined(__has_attribute)
    +#  if __has_attribute(argument_with_type_tag) && \
    +      __has_attribute(pointer_with_type_tag) && \
    +      __has_attribute(type_tag_for_datatype)
    +#    define ATTR_MPI_PWT(buffer_idx, type_idx) __attribute__((pointer_with_type_tag(mpi,buffer_idx,type_idx)))
    +/* ... other macros ... */
    +#  endif
    +#endif
    +
    +#if !defined(ATTR_MPI_PWT)
    +#define ATTR_MPI_PWT(buffer_idx, type_idx)
    +#endif
    +
    +int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
    +    ATTR_MPI_PWT(1,3);
    +
    +
    + +

    argument_with_type_tag(...)

    + +

    Use __attribute__((argument_with_type_tag(arg_kind, arg_idx, +type_tag_idx))) on a function declaration to specify that the function +accepts a type tag that determines the type of some other argument. +arg_kind is an identifier that should be used when annotating all +applicable type tags.

    + +

    This attribute is primarily useful for checking arguments of variadic +functions (pointer_with_type_tag can be used in most of non-variadic +cases).

    + +

    For example:

    +
    +
    +int fcntl(int fd, int cmd, ...)
    +      __attribute__(( argument_with_type_tag(fcntl,3,2) ));
    +
    +
    + +

    pointer_with_type_tag(...)

    + +

    Use __attribute__((pointer_with_type_tag(ptr_kind, ptr_idx, +type_tag_idx))) on a function declaration to specify that the +function a type tag that determines the pointee type of some other pointer +argument.

    + +

    For example:

    +
    +
    +int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
    +    __attribute__(( pointer_with_type_tag(mpi,1,3) ));
    +
    +
    + +

    type_tag_for_datatype(...)

    + +

    Clang supports annotating type tags of two forms.

    + +
      +
    • Type tag that is an expression containing a reference to some declared +identifier. Use __attribute__((type_tag_for_datatype(kind, type))) +on a declaration with that identifier: + +
      +
      +extern struct mpi_datatype mpi_datatype_int
      +    __attribute__(( type_tag_for_datatype(mpi,int) ));
      +#define MPI_INT ((MPI_Datatype) &mpi_datatype_int)
      +
      +
    • + +
    • Type tag that is an integral literal. Introduce a static +const variable with a corresponding initializer value and attach +__attribute__((type_tag_for_datatype(kind, type))) on that +declaration, for example: + +
      +
      +#define MPI_INT ((MPI_Datatype) 42)
      +static const MPI_Datatype mpi_datatype_int
      +    __attribute__(( type_tag_for_datatype(mpi,int) )) = 42
      +
      +
    • +
    + +

    The attribute also accepts an optional third argument that determines how +the expression is compared to the type tag. There are two supported flags:

    + +
    • layout_compatible will cause types to be compared according to +layout-compatibility rules (C++11 [class.mem] p 17, 18). This is +implemented to support annotating types like MPI_DOUBLE_INT. + +

      For example:

      +
      +
      +/* In mpi.h */
      +struct internal_mpi_double_int { double d; int i; };
      +extern struct mpi_datatype mpi_datatype_double_int
      +    __attribute__(( type_tag_for_datatype(mpi, struct internal_mpi_double_int,
      +                                          layout_compatible) ));
      +
      +#define MPI_DOUBLE_INT ((MPI_Datatype) &mpi_datatype_double_int)
      +
      +/* In user code */
      +struct my_pair { double a; int b; };
      +struct my_pair *buffer;
      +MPI_Send(buffer, 1, MPI_DOUBLE_INT /*, ... */); // no warning
      +
      +struct my_int_pair { int a; int b; }
      +struct my_int_pair *buffer2;
      +MPI_Send(buffer2, 1, MPI_DOUBLE_INT /*, ... */); // warning: actual buffer element
      +                                                 // type 'struct my_int_pair'
      +                                                 // doesn't match specified MPI_Datatype
      +
      +
      +
    • + +
    • must_be_null specifies that the expression should be a null +pointer constant, for example: + +
      +
      +/* In mpi.h */
      +extern struct mpi_datatype mpi_datatype_null
      +    __attribute__(( type_tag_for_datatype(mpi, void, must_be_null) ));
      +
      +#define MPI_DATATYPE_NULL ((MPI_Datatype) &mpi_datatype_null)
      +
      +/* In user code */
      +MPI_Send(buffer, 1, MPI_DATATYPE_NULL /*, ... */); // warning: MPI_DATATYPE_NULL
      +                                                   // was specified but buffer
      +                                                   // is not a null pointer
      +
      +
      +
    • +
    + Modified: vendor/clang/dist/docs/ReleaseNotes.html ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.html Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/docs/ReleaseNotes.html Sun Aug 19 10:33:04 2012 (r239392) @@ -186,6 +186,25 @@ supported by the target, or if the compi model can be used.

    +

    Type safety attributes

    +

    Clang now supports type safety attributes that allow checking during compile +time that 'void *' function arguments and arguments for variadic functions are +of a particular type which is determined by some other argument to the same +function call.

    + +

    Usecases include:

    +
      +
    • MPI library implementations, where these attributes enable checking that + buffer type matches the passed MPI_Datatype;
    • +
    • HDF5 library -- similar usecase as for MPI;
    • +
    • checking types of variadic functions' arguments for functions like +fcntl() and ioctl().
    • +
    + +

    See entries for argument_with_type_tag, +pointer_with_type_tag and type_tag_for_datatype +attributes in Clang language extensions documentation.

    +

    New Compiler Flags

    Added: vendor/clang/dist/docs/analyzer/IPA.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/docs/analyzer/IPA.txt Sun Aug 19 10:33:04 2012 (r239392) @@ -0,0 +1,96 @@ +Inlining +======== + +Inlining Modes +----------------------- +-analyzer-ipa=none - All inlining is disabled. +-analyzer-ipa=inlining - Turns on inlining when we can confidently find the function/method body corresponding to the call. (C functions, static functions, devirtualized C++ methods, ObjC class methods, ObjC instance methods when we are confident about the dynamic type of the instance). +-analyzer-ipa=dynamic - Inline instance methods for which the type is determined at runtime and we are not 100% sure that our type info is correct. For virtual calls, inline the most plausible definition. +-analyzer-ipa=dynamic-bifurcate - Same as -analyzer-ipa=dynamic, but the path is split. We inline on one branch and do not inline on the other. This mode does not drop the coverage in cases when the parent class has code that is only exercised when some of its methods are overriden. + +Currently, -analyzer-ipa=inlining is the default mode. + +Basics of Implementation +----------------------- + +The low-level mechanism of inlining a function is handled in ExprEngine::inlineCall and ExprEngine::processCallExit. If the conditions are right for inlining, a CallEnter node is created and added to the analysis work list. The CallEnter node marks the change to a new LocationContext representing the called function, and its state includes the contents of the new stack frame. When the CallEnter node is actually processed, its single successor will be a edge to the first CFG block in the function. + +Exiting an inlined function is a bit more work, fortunately broken up into reasonable steps: +1. The CoreEngine realizes we're at the end of an inlined call and generates a CallExitBegin node. +2. ExprEngine takes over (in processCallExit) and finds the return value of the function, if it has one. This is bound to the expression that triggered the call. (In the case of calls without origin expressions, such as destructors, this step is skipped.) +3. Dead symbols and bindings are cleaned out from the state, including any local bindings. +4. A CallExitEnd node is generated, which marks the transition back to the caller's LocationContext. +5. Custom post-call checks are processed and the final nodes are pushed back onto the work list, so that evaluation of the caller can continue. + +Retry Without Inlining +----------------------- + +In some cases, we would like to retry analyzes without inlining the particular call. Currently, we use this technique to recover the coverage in case we stop analyzing a path due to exceeding the maximum block count inside an inlined function. When this situation is detected, we walk up the path to find the first node before inlining was started and enqueue it on the WorkList with a special ReplayWithoutInlining bit added to it (ExprEngine::replayWithoutInlining). + +Deciding when to inline +----------------------- +In general, we try to inline as much as possible, since it provides a better summary of what actually happens in the program. However, there are some cases where we choose not to inline: +- if there is no definition available (of course) +- if we can't create a CFG or compute variable liveness for the function +- if we reach a cutoff of maximum stack depth (to avoid infinite recursion) +- if the function is variadic +- in C++, we don't inline constructors unless we know the destructor will be inlined as well +- in C++, we don't inline allocators (custom operator new implementations), since we don't properly handle deallocators (at the time of this writing) +- "Dynamic" calls are handled specially; see below. +- Engine:FunctionSummaries map stores additional information about declarations, some of which is collected at runtime based on previous analyzes of the function. We do not inline functions which were not profitable to inline in a different context (for example, if the maximum block count was exceeded, see Retry Without Inlining). + + +Dynamic calls and devirtualization +---------------------------------- +"Dynamic" calls are those that are resolved at runtime, such as C++ virtual method calls and Objective-C message sends. Due to the path-sensitive nature of the analyzer, we may be able to figure out the dynamic type of the object whose method is being called and thus "devirtualize" the call, i.e. find the actual method that will be called at runtime. (Obviously this is not always possible.) This is handled by CallEvent's getRuntimeDefinition method. + +Type information is tracked as DynamicTypeInfo, stored within the program state. If no DynamicTypeInfo has been explicitly set for a region, it will be inferred from the region's type or associated symbol. Information from symbolic regions is weaker than from true typed regions; a C++ object declared "A obj" is known to have the class 'A', but a reference "A &ref" may dynamically be a subclass of 'A'. The DynamicTypePropagation checker gathers and propagates the type information. + +(Warning: not all of the existing analyzer code has been retrofitted to use DynamicTypeInfo, nor is it universally appropriate. In particular, DynamicTypeInfo always applies to a region with all casts stripped off, but sometimes the information provided by casts can be useful.) + +When asked to provide a definition, the CallEvents for dynamic calls will use the type info in their state to provide the best definition of the method to be called. In some cases this devirtualization can be perfect or near-perfect, and we can inline the definition as usual. In others we can make a guess, but report that our guess may not be the method actually called at runtime. + +The -analyzer-ipa option has four different modes: none, inlining, dynamic, and dynamic-bifurcate. Under -analyzer-ipa=dynamic, all dynamic calls are inlined, whether we are certain or not that this will actually be the definition used at runtime. Under -analyzer-ipa=inlining, only "near-perfect" devirtualized calls are inlined*, and other dynamic calls are evaluated conservatively (as if no definition were available). + +* Currently, no Objective-C messages are not inlined under -analyzer-ipa=inlining, even if we are reasonably confident of the type of the receiver. We plan to enable this once we have tested our heuristics more thoroughly. + +The last option, -analyzer-ipa=dynamic-bifurcate, behaves similarly to "dynamic", but performs a conservative invalidation in the general virtual case in /addition/ to inlining. The details of this are discussed below. + + +Bifurcation +----------- +ExprEngine::BifurcateCall implements the -analyzer-ipa=dynamic-bifurcate mode. When a call is made on a region with dynamic type information, we bifurcate the path and add the region's processing mode to the GDM. Currently, there are 2 modes: DynamicDispatchModeInlined and DynamicDispatchModeConservative. Going forward, we consult the state of the region to make decisions on whether the calls should be inlined or not, which ensures that we have at most one split per region. The modes model the cases when the dynamic type information is perfectly correct and when the info is not correct (i.e. where the region is a subclass of the type we store in DynamicTypeInfo). + +Bifurcation mode allows for increased coverage in cases where the parent method contains code which is only executed when the class is subclassed. The disadvantages of this mode are a (considerable?) performance hit and the possibility of false positives on the path where the conservative mode is used. + + +Objective-C Message Heuristics +------------------------------ +We rely on a set of heuristics to partition the set of ObjC method calls into ones that require bifurcation and ones that do not (can or cannot be a subclass). Below are the cases when we consider that the dynamic type of the object is precise (cannot be a subclass): + - If the object was created with +alloc or +new and initialized with an -init method. + - If the calls are property accesses using dot syntax. This is based on the assumption that children rarely override properties, or do so in an essentially compatible way. + - If the class interface is declared inside the main source file. In this case it is unlikely that it will be subclassed. + - If the method is not declared outside of main source file, either by the receiver's class or by any superclasses. + + +C++ Inlining Caveats +-------------------- +C++11 [class.cdtor]p4 describes how the vtable of an object is modified as it is being constructed or destructed; that is, the type of the object depends on which base constructors have been completed. This is tracked using dynamic type info in the DynamicTypePropagation checker. + +Temporaries are poorly modelled right now because we're not confident in the placement + +'new' is poorly modelled due to some nasty CFG/design issues (elaborated in PR12014). 'delete' is essentially not modelled at all. + +Arrays of objects are modeled very poorly right now. We run only the first constructor and first destructor. Because of this, we don't inline any constructors or destructors for arrays. + + +CallEvent +========= + +A CallEvent represents a specific call to a function, method, or other body of code. It is path-sensitive, containing both the current state (ProgramStateRef) and stack space (LocationContext), and provides uniform access to the argument values and return type of a call, no matter how the call is written in the source or what sort of code body is being invoked. + +(For those familiar with Cocoa, CallEvent is roughly equivalent to NSInvocation.) + +CallEvent should be used whenever there is logic dealing with function calls that does not care how the call occurred. Examples include checking that arguments satisfy preconditions (such as __attribute__((nonnull))), and attempting to inline a call. + +CallEvents are reference-counted objects managed by a CallEventManager. While there is no inherent issue with persisting them (say, in the state's GDM), they are intended for short-lived use, and can be recreated from CFGElements or StackFrameContexts fairly easily. Modified: vendor/clang/dist/include/clang/AST/ASTContext.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ASTContext.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/ASTContext.h Sun Aug 19 10:33:04 2012 (r239392) @@ -474,8 +474,17 @@ public: Data.setPointer(RC); } + const Decl *getOriginalDecl() const LLVM_READONLY { + return OriginalDecl; + } + + void setOriginalDecl(const Decl *Orig) { + OriginalDecl = Orig; + } + private: llvm::PointerIntPair Data; + const Decl *OriginalDecl; }; /// \brief Mapping from declarations to comments attached to any @@ -485,6 +494,10 @@ public: /// lazily. mutable llvm::DenseMap RedeclComments; + /// \brief Mapping from declarations to parsed comments attached to any + /// redeclaration. + mutable llvm::DenseMap ParsedComments; + /// \brief Return the documentation comment attached to a given declaration, /// without looking into cache. RawComment *getRawCommentForDeclNoCache(const Decl *D) const; @@ -500,7 +513,12 @@ public: /// \brief Return the documentation comment attached to a given declaration. /// Returns NULL if no comment is attached. - const RawComment *getRawCommentForAnyRedecl(const Decl *D) const; + /// + /// \param OriginalDecl if not NULL, is set to declaration AST node that had + /// the comment, if the comment we found comes from a redeclaration. + const RawComment *getRawCommentForAnyRedecl( + const Decl *D, + const Decl **OriginalDecl = NULL) const; /// Return parsed documentation comment attached to a given declaration. /// Returns NULL if no comment is attached. Modified: vendor/clang/dist/include/clang/AST/Attr.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Attr.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/Attr.h Sun Aug 19 10:33:04 2012 (r239392) @@ -105,7 +105,8 @@ public: virtual bool isLateParsed() const { return false; } // Pretty print this attribute. - virtual void printPretty(llvm::raw_ostream &OS, ASTContext &C) const = 0; + virtual void printPretty(llvm::raw_ostream &OS, + const PrintingPolicy &Policy) const = 0; // Implement isa/cast/dyncast/etc. static bool classof(const Attr *) { return true; } Modified: vendor/clang/dist/include/clang/AST/CommentCommandTraits.h ============================================================================== --- vendor/clang/dist/include/clang/AST/CommentCommandTraits.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/CommentCommandTraits.h Sun Aug 19 10:33:04 2012 (r239392) @@ -35,14 +35,14 @@ public: /// A verbatim-like block command eats every character (except line starting /// decorations) until matching end command is seen or comment end is hit. /// - /// \param BeginName name of the command that starts the verbatim block. + /// \param StartName name of the command that starts the verbatim block. /// \param [out] EndName name of the command that ends the verbatim block. /// /// \returns true if a given command is a verbatim block command. bool isVerbatimBlockCommand(StringRef StartName, StringRef &EndName) const; /// \brief Register a new verbatim block command. - void addVerbatimBlockCommand(StringRef BeginName, StringRef EndName); + void addVerbatimBlockCommand(StringRef StartName, StringRef EndName); /// \brief Check if a given command is a verbatim line command. /// @@ -90,7 +90,7 @@ public: private: struct VerbatimBlockCommand { - StringRef BeginName; + StringRef StartName; StringRef EndName; }; Modified: vendor/clang/dist/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclBase.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/DeclBase.h Sun Aug 19 10:33:04 2012 (r239392) @@ -858,10 +858,10 @@ public: raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation = 0); // Debuggers don't usually respect default arguments. - LLVM_ATTRIBUTE_USED void dump() const { dump(llvm::errs()); } + LLVM_ATTRIBUTE_USED void dump() const; void dump(raw_ostream &Out) const; // Debuggers don't usually respect default arguments. - LLVM_ATTRIBUTE_USED void dumpXML() const { dumpXML(llvm::errs()); } + LLVM_ATTRIBUTE_USED void dumpXML() const; void dumpXML(raw_ostream &OS) const; private: Modified: vendor/clang/dist/include/clang/AST/DeclCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclCXX.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/DeclCXX.h Sun Aug 19 10:33:04 2012 (r239392) @@ -1646,14 +1646,17 @@ public: /// \brief Find the method in RD that corresponds to this one. /// /// Find if RD or one of the classes it inherits from override this method. - /// If so, return it. RD is assumed to be a base class of the class defining - /// this method (or be the class itself). + /// If so, return it. RD is assumed to be a subclass of the class defining + /// this method (or be the class itself), unless MayBeBase is set to true. CXXMethodDecl * - getCorrespondingMethodInClass(const CXXRecordDecl *RD); + getCorrespondingMethodInClass(const CXXRecordDecl *RD, + bool MayBeBase = false); const CXXMethodDecl * - getCorrespondingMethodInClass(const CXXRecordDecl *RD) const { - return const_cast(this)->getCorrespondingMethodInClass(RD); + getCorrespondingMethodInClass(const CXXRecordDecl *RD, + bool MayBeBase = false) const { + return const_cast(this) + ->getCorrespondingMethodInClass(RD, MayBeBase); } // Implement isa/cast/dyncast/etc. Modified: vendor/clang/dist/include/clang/AST/DeclGroup.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclGroup.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/DeclGroup.h Sun Aug 19 10:33:04 2012 (r239392) @@ -26,7 +26,11 @@ class DeclGroupIterator; class DeclGroup { // FIXME: Include a TypeSpecifier object. - unsigned NumDecls; + union { + unsigned NumDecls; + + Decl *Aligner; + }; private: DeclGroup() : NumDecls(0) {} Modified: vendor/clang/dist/include/clang/AST/DeclLookups.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclLookups.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/DeclLookups.h Sun Aug 19 10:33:04 2012 (r239392) @@ -67,7 +67,7 @@ public: DeclContext::all_lookups_iterator DeclContext::lookups_begin() const { DeclContext *Primary = const_cast(this)->getPrimaryContext(); - if (hasExternalVisibleStorage()) + if (Primary->hasExternalVisibleStorage()) getParentASTContext().getExternalSource()->completeVisibleDeclsMap(Primary); if (StoredDeclsMap *Map = Primary->buildLookup()) return all_lookups_iterator(Map->begin(), Map->end()); @@ -76,7 +76,7 @@ DeclContext::all_lookups_iterator DeclCo DeclContext::all_lookups_iterator DeclContext::lookups_end() const { DeclContext *Primary = const_cast(this)->getPrimaryContext(); - if (hasExternalVisibleStorage()) + if (Primary->hasExternalVisibleStorage()) getParentASTContext().getExternalSource()->completeVisibleDeclsMap(Primary); if (StoredDeclsMap *Map = Primary->buildLookup()) return all_lookups_iterator(Map->end(), Map->end()); Modified: vendor/clang/dist/include/clang/AST/PrettyPrinter.h ============================================================================== --- vendor/clang/dist/include/clang/AST/PrettyPrinter.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/PrettyPrinter.h Sun Aug 19 10:33:04 2012 (r239392) @@ -34,19 +34,19 @@ public: struct PrintingPolicy { /// \brief Create a default printing policy for C. PrintingPolicy(const LangOptions &LO) - : Indentation(2), LangOpts(LO), SuppressSpecifiers(false), + : LangOpts(LO), Indentation(2), SuppressSpecifiers(false), SuppressTagKeyword(false), SuppressTag(false), SuppressScope(false), SuppressUnwrittenScope(false), SuppressInitializers(false), - Dump(false), ConstantArraySizeAsWritten(false), - AnonymousTagLocations(true), SuppressStrongLifetime(false), - Bool(LO.Bool) { } - - /// \brief The number of spaces to use to indent each line. - unsigned Indentation : 8; + ConstantArraySizeAsWritten(false), AnonymousTagLocations(true), + SuppressStrongLifetime(false), Bool(LO.Bool), + DumpSourceManager(0) { } /// \brief What language we're printing. LangOptions LangOpts; + /// \brief The number of spaces to use to indent each line. + unsigned Indentation : 8; + /// \brief Whether we should suppress printing of the actual specifiers for /// the given type or declaration. /// @@ -103,12 +103,6 @@ struct PrintingPolicy { /// internal initializer constructed for x will not be printed. bool SuppressInitializers : 1; - /// \brief True when we are "dumping" rather than "pretty-printing", - /// where dumping involves printing the internal details of the AST - /// and pretty-printing involves printing something similar to - /// source code. - bool Dump : 1; - /// \brief Whether we should print the sizes of constant array expressions /// as written in the sources. /// @@ -139,6 +133,12 @@ struct PrintingPolicy { /// \brief Whether we can use 'bool' rather than '_Bool', even if the language /// doesn't actually have 'bool' (because, e.g., it is defined as a macro). unsigned Bool : 1; + + /// \brief If we are "dumping" rather than "pretty-printing", this points to + /// a SourceManager which will be used to dump SourceLocations. Dumping + /// involves printing the internal details of the AST and pretty-printing + /// involves printing something similar to source code. + SourceManager *DumpSourceManager; }; } // end namespace clang Modified: vendor/clang/dist/include/clang/AST/RawCommentList.h ============================================================================== --- vendor/clang/dist/include/clang/AST/RawCommentList.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/RawCommentList.h Sun Aug 19 10:33:04 2012 (r239392) @@ -55,16 +55,11 @@ public: /// Is this comment attached to any declaration? bool isAttached() const LLVM_READONLY { - return !DeclOrParsedComment.isNull(); + return IsAttached; } - /// Return the declaration that this comment is attached to. - const Decl *getDecl() const; - - /// Set the declaration that this comment is attached to. - void setDecl(const Decl *D) { - assert(DeclOrParsedComment.isNull()); - DeclOrParsedComment = D; + void setAttached() { + IsAttached = true; } /// Returns true if it is a comment that should be put after a member: @@ -118,28 +113,23 @@ public: return extractBriefText(Context); } - /// Returns a \c FullComment AST node, parsing the comment if needed. - comments::FullComment *getParsed(const ASTContext &Context) const { - if (comments::FullComment *FC = - DeclOrParsedComment.dyn_cast()) - return FC; - - return parse(Context); - } + /// Parse the comment, assuming it is attached to decl \c D. + comments::FullComment *parse(const ASTContext &Context, const Decl *D) const; private: SourceRange Range; mutable StringRef RawText; mutable const char *BriefText; - mutable llvm::PointerUnion - DeclOrParsedComment; mutable bool RawTextValid : 1; ///< True if RawText is valid mutable bool BriefTextValid : 1; ///< True if BriefText is valid unsigned Kind : 3; + /// True if comment is attached to a declaration in ASTContext. + bool IsAttached : 1; + bool IsTrailingComment : 1; bool IsAlmostTrailingComment : 1; @@ -152,7 +142,7 @@ private: RawComment(SourceRange SR, CommentKind K, bool IsTrailingComment, bool IsAlmostTrailingComment) : Range(SR), RawTextValid(false), BriefTextValid(false), Kind(K), - IsTrailingComment(IsTrailingComment), + IsAttached(false), IsTrailingComment(IsTrailingComment), IsAlmostTrailingComment(IsAlmostTrailingComment), BeginLineValid(false), EndLineValid(false) { } @@ -161,8 +151,6 @@ private: const char *extractBriefText(const ASTContext &Context) const; - comments::FullComment *parse(const ASTContext &Context) const; - friend class ASTReader; }; Modified: vendor/clang/dist/include/clang/AST/Stmt.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Stmt.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/Stmt.h Sun Aug 19 10:33:04 2012 (r239392) @@ -373,15 +373,9 @@ public: /// dumpPretty/printPretty - These two methods do a "pretty print" of the AST /// back to its original source language syntax. - void dumpPretty(ASTContext& Context) const; + void dumpPretty(ASTContext &Context) const; void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, - unsigned Indentation = 0) const { - printPretty(OS, *(ASTContext*)0, Helper, Policy, Indentation); - } - void printPretty(raw_ostream &OS, ASTContext &Context, - PrinterHelper *Helper, - const PrintingPolicy &Policy, unsigned Indentation = 0) const; /// viewAST - Visualize an AST rooted at this Stmt* using GraphViz. Only @@ -1620,36 +1614,40 @@ public: /// MSAsmStmt - This represents a MS inline-assembly statement extension. /// class MSAsmStmt : public Stmt { - SourceLocation AsmLoc, EndLoc; + SourceLocation AsmLoc, LBraceLoc, EndLoc; std::string AsmStr; bool IsSimple; bool IsVolatile; unsigned NumAsmToks; - unsigned NumLineEnds; + unsigned NumInputs; + unsigned NumOutputs; unsigned NumClobbers; Token *AsmToks; - unsigned *LineEnds; + IdentifierInfo **Names; Stmt **Exprs; StringRef *Clobbers; public: - MSAsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, - bool isvolatile, ArrayRef asmtoks, - ArrayRef lineends, StringRef asmstr, - ArrayRef clobbers, SourceLocation endloc); + MSAsmStmt(ASTContext &C, SourceLocation asmloc, SourceLocation lbraceloc, + bool issimple, bool isvolatile, ArrayRef asmtoks, + ArrayRef inputs, ArrayRef outputs, + StringRef asmstr, ArrayRef clobbers, + SourceLocation endloc); SourceLocation getAsmLoc() const { return AsmLoc; } void setAsmLoc(SourceLocation L) { AsmLoc = L; } + SourceLocation getLBraceLoc() const { return LBraceLoc; } + void setLBraceLoc(SourceLocation L) { LBraceLoc = L; } SourceLocation getEndLoc() const { return EndLoc; } void setEndLoc(SourceLocation L) { EndLoc = L; } + bool hasBraces() const { return LBraceLoc.isValid(); } + unsigned getNumAsmToks() { return NumAsmToks; } Token *getAsmToks() { return AsmToks; } - unsigned getNumLineEnds() { return NumLineEnds; } - unsigned *getLineEnds() { return LineEnds; } bool isVolatile() const { return IsVolatile; } void setVolatile(bool V) { IsVolatile = V; } @@ -1665,7 +1663,7 @@ public: //===--- Other ---===// unsigned getNumClobbers() const { return NumClobbers; } - StringRef getClobber(unsigned i) { return Clobbers[i]; } + StringRef getClobber(unsigned i) const { return Clobbers[i]; } SourceRange getSourceRange() const LLVM_READONLY { return SourceRange(AsmLoc, EndLoc); Modified: vendor/clang/dist/include/clang/AST/TemplateBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/TemplateBase.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/TemplateBase.h Sun Aug 19 10:33:04 2012 (r239392) @@ -510,17 +510,23 @@ public: /// This is safe to be used inside an AST node, in contrast with /// TemplateArgumentListInfo. struct ASTTemplateArgumentListInfo { - /// \brief The source location of the left angle bracket ('<'); + /// \brief The source location of the left angle bracket ('<'). SourceLocation LAngleLoc; - /// \brief The source location of the right angle bracket ('>'); + /// \brief The source location of the right angle bracket ('>'). SourceLocation RAngleLoc; - /// \brief The number of template arguments in TemplateArgs. - /// The actual template arguments (if any) are stored after the - /// ExplicitTemplateArgumentList structure. - unsigned NumTemplateArgs; - + union { + /// \brief The number of template arguments in TemplateArgs. + /// The actual template arguments (if any) are stored after the + /// ExplicitTemplateArgumentList structure. + unsigned NumTemplateArgs; + + /// Force ASTTemplateArgumentListInfo to the right alignment + /// for the following array of TemplateArgumentLocs. + void *Aligner; + }; + /// \brief Retrieve the template arguments TemplateArgumentLoc *getTemplateArgs() { return reinterpret_cast (this + 1); Modified: vendor/clang/dist/include/clang/AST/TypeLoc.h ============================================================================== --- vendor/clang/dist/include/clang/AST/TypeLoc.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/AST/TypeLoc.h Sun Aug 19 10:33:04 2012 (r239392) @@ -1061,7 +1061,6 @@ public: struct FunctionLocInfo { SourceLocation LocalRangeBegin; SourceLocation LocalRangeEnd; - bool TrailingReturn; }; /// \brief Wrapper for source info for functions. @@ -1084,13 +1083,6 @@ public: getLocalData()->LocalRangeEnd = L; } - bool getTrailingReturn() const { - return getLocalData()->TrailingReturn; - } - void setTrailingReturn(bool Trailing) { - getLocalData()->TrailingReturn = Trailing; - } - ArrayRef getParams() const { return ArrayRef(getParmArray(), getNumArgs()); } @@ -1119,7 +1111,6 @@ public: void initializeLocal(ASTContext &Context, SourceLocation Loc) { setLocalRangeBegin(Loc); setLocalRangeEnd(Loc); - setTrailingReturn(false); for (unsigned i = 0, e = getNumArgs(); i != e; ++i) setArg(i, NULL); } Modified: vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h ============================================================================== --- vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Sun Aug 19 10:33:04 2012 (r239392) @@ -50,6 +50,7 @@ #include "clang/ASTMatchers/ASTMatchersMacros.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/Regex.h" +#include namespace clang { namespace ast_matchers { @@ -195,6 +196,75 @@ AST_MATCHER_P(ClassTemplateSpecializatio return false; } +/// \brief Matches expressions that match InnerMatcher after any implicit casts +/// are stripped off. +/// +/// Parentheses and explicit casts are not discarded. +/// Given +/// int arr[5]; +/// int a = 0; +/// char b = 0; +/// const int c = a; +/// int *d = arr; +/// long e = (long) 0l; +/// The matchers +/// variable(hasInitializer(ignoringImpCasts(integerLiteral()))) +/// variable(hasInitializer(ignoringImpCasts(declarationReference()))) +/// would match the declarations for a, b, c, and d, but not e. +/// while +/// variable(hasInitializer(integerLiteral())) +/// variable(hasInitializer(declarationReference())) +/// only match the declarations for b, c, and d. +AST_MATCHER_P(Expr, ignoringImpCasts, + internal::Matcher, InnerMatcher) { + return InnerMatcher.matches(*Node.IgnoreImpCasts(), Finder, Builder); +} + +/// \brief Matches expressions that match InnerMatcher after parentheses and +/// casts are stripped off. +/// +/// Implicit and non-C Style casts are also discarded. +/// Given +/// int a = 0; +/// char b = (0); +/// void* c = reinterpret_cast(0); +/// char d = char(0); +/// The matcher +/// variable(hasInitializer(ignoringParenCasts(integerLiteral()))) +/// would match the declarations for a, b, c, and d. +/// while +/// variable(hasInitializer(integerLiteral())) +/// only match the declaration for a. +AST_MATCHER_P(Expr, ignoringParenCasts, internal::Matcher, InnerMatcher) { + return InnerMatcher.matches(*Node.IgnoreParenCasts(), Finder, Builder); +} + +/// \brief Matches expressions that match InnerMatcher after implicit casts and +/// parentheses are stripped off. +/// +/// Explicit casts are not discarded. +/// Given +/// int arr[5]; +/// int a = 0; +/// char b = (0); +/// const int c = a; +/// int *d = (arr); +/// long e = ((long) 0l); +/// The matchers +/// variable(hasInitializer(ignoringParenImpCasts( +/// integerLiteral()))) +/// variable(hasInitializer(ignoringParenImpCasts( +/// declarationReference()))) +/// would match the declarations for a, b, c, and d, but not e. +/// while +/// variable(hasInitializer(integerLiteral())) +/// variable(hasInitializer(declarationReference())) +/// would only match the declaration for a. +AST_MATCHER_P(Expr, ignoringParenImpCasts, + internal::Matcher, InnerMatcher) { + return InnerMatcher.matches(*Node.IgnoreParenImpCasts(), Finder, Builder); +} + /// \brief Matches classTemplateSpecializations where the n'th TemplateArgument /// matches the given Matcher. /// @@ -691,6 +761,19 @@ const internal::VariadicDynCastAllOfMatc Expr, ImplicitCastExpr> implicitCast; +/// \brief Matches any cast nodes of Clang's AST. +/// +/// Example: castExpr() matches each of the following: +/// (int) 3; +/// const_cast(SubExpr); +/// char c = 0; +/// but does not match +/// int i = (0); +/// int k = 0; +const internal::VariadicDynCastAllOfMatcher< + Expr, + CastExpr> castExpr; + /// \brief Matches functional cast expressions /// /// Example: Matches Foo(bar); @@ -1193,6 +1276,21 @@ AST_MATCHER_P(DeclRefExpr, throughUsingD return false; } +/// \brief Matches the Decl of a DeclStmt which has a single declaration. +/// +/// Given +/// int a, b; +/// int c; +/// declarationStatement(hasSingleDecl(anything())) +/// matches 'int c;' but not 'int a, b;'. +AST_MATCHER_P(DeclStmt, hasSingleDecl, internal::Matcher, InnerMatcher) { + if (Node.isSingleDecl()) { + const Decl *FoundDecl = Node.getSingleDecl(); + return InnerMatcher.matches(*FoundDecl, Finder, Builder); + } + return false; +} + /// \brief Matches a variable declaration that has an initializer expression /// that matches the given matcher. /// @@ -1238,6 +1336,44 @@ AST_POLYMORPHIC_MATCHER_P2( *Node.getArg(N)->IgnoreParenImpCasts(), Finder, Builder)); } +/// \brief Matches declaration statements that contain a specific number of +/// declarations. +/// +/// Example: Given +/// int a, b; +/// int c; +/// int d = 2, e; +/// declCountIs(2) +/// matches 'int a, b;' and 'int d = 2, e;', but not 'int c;'. +AST_MATCHER_P(DeclStmt, declCountIs, unsigned, N) { + return std::distance(Node.decl_begin(), Node.decl_end()) == N; +} + +/// \brief Matches the n'th declaration of a declaration statement. +/// +/// Note that this does not work for global declarations because the AST +/// breaks up multiple-declaration DeclStmt's into multiple single-declaration +/// DeclStmt's. +/// Example: Given non-global declarations +/// int a, b = 0; +/// int c; +/// int d = 2, e; +/// declarationStatement(containsDeclaration( +/// 0, variable(hasInitializer(anything())))) +/// matches only 'int d = 2, e;', and +/// declarationStatement(containsDeclaration(1, variable())) +/// matches 'int a, b = 0' as well as 'int d = 2, e;' +/// but 'int c;' is not matched. +AST_MATCHER_P2(DeclStmt, containsDeclaration, unsigned, N, + internal::Matcher, InnerMatcher) { + const unsigned NumDecls = std::distance(Node.decl_begin(), Node.decl_end()); + if (N >= NumDecls) + return false; + DeclStmt::const_decl_iterator Iterator = Node.decl_begin(); + std::advance(Iterator, N); + return InnerMatcher.matches(**Iterator, Finder, Builder); +} + /// \brief Matches a constructor initializer. /// /// Given @@ -1385,6 +1521,18 @@ AST_MATCHER_P(FunctionDecl, returns, int return Matcher.matches(Node.getResultType(), Finder, Builder); } +/// \brief Matches extern "C" function declarations. +/// +/// Given: +/// extern "C" void f() {} +/// extern "C" { void g() {} } +/// void h() {} +/// function(isExternC()) +/// matches the declaration of f and g, but not the declaration h +AST_MATCHER(FunctionDecl, isExternC) { + return Node.isExternC(); +} + /// \brief Matches the condition expression of an if statement, for loop, /// or conditional operator. /// Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/Basic/Attr.td Sun Aug 19 10:33:04 2012 (r239392) @@ -826,6 +826,27 @@ def SharedLocksRequired : InheritableAtt let TemplateDependent = 1; } +// Type safety attributes for `void *' pointers and type tags. + +def ArgumentWithTypeTag : InheritableAttr { + let Spellings = [GNU<"argument_with_type_tag">, + GNU<"pointer_with_type_tag">]; + let Args = [IdentifierArgument<"ArgumentKind">, + UnsignedArgument<"ArgumentIdx">, + UnsignedArgument<"TypeTagIdx">, + BoolArgument<"IsPointer">]; + let Subjects = [Function]; +} + +def TypeTagForDatatype : InheritableAttr { + let Spellings = [GNU<"type_tag_for_datatype">]; + let Args = [IdentifierArgument<"ArgumentKind">, + TypeArgument<"MatchingCType">, + BoolArgument<"LayoutCompatible">, + BoolArgument<"MustBeNull">]; + let Subjects = [Var]; +} + // Microsoft-related attributes def MsStruct : InheritableAttr { Modified: vendor/clang/dist/include/clang/Basic/Builtins.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/Builtins.def Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/Basic/Builtins.def Sun Aug 19 10:33:04 2012 (r239392) @@ -376,9 +376,9 @@ BUILTIN(__builtin_ctz , "iUi" , "nc") BUILTIN(__builtin_ctzl , "iULi" , "nc") BUILTIN(__builtin_ctzll, "iULLi", "nc") // TODO: int ctzimax(uintmax_t) -BUILTIN(__builtin_ffs , "iUi" , "nc") -BUILTIN(__builtin_ffsl , "iULi" , "nc") -BUILTIN(__builtin_ffsll, "iULLi", "nc") +BUILTIN(__builtin_ffs , "ii" , "nc") +BUILTIN(__builtin_ffsl , "iLi" , "nc") +BUILTIN(__builtin_ffsll, "iLLi", "nc") BUILTIN(__builtin_parity , "iUi" , "nc") BUILTIN(__builtin_parityl , "iULi" , "nc") BUILTIN(__builtin_parityll, "iULLi", "nc") Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Sun Aug 19 10:32:32 2012 (r239391) +++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Sun Aug 19 10:33:04 2012 (r239392) @@ -155,6 +155,8 @@ def MethodAccess : DiagGroup<"objc-metho def ObjCReceiver : DiagGroup<"receiver-expr">; def OverlengthStrings : DiagGroup<"overlength-strings">; def OverloadedVirtual : DiagGroup<"overloaded-virtual">; +def PrivateExtern : DiagGroup<"private-extern">; +def SelTypeCast : DiagGroup<"cast-of-sel-type">; def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">; def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">; def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">; @@ -341,6 +343,8 @@ def FormatNonLiteral : DiagGroup<"format def Format2 : DiagGroup<"format=2", [FormatNonLiteral, FormatSecurity, FormatY2K]>; +def TypeSafety : DiagGroup<"type-safety">; + def Extra : DiagGroup<"extra", [ MissingFieldInitializers, IgnoredQualifiers, @@ -371,7 +375,9 @@ def Most : DiagGroup<"most", [ Unused, VolatileRegisterVar, ObjCMissingSuperCalls, - OverloadedVirtual + OverloadedVirtual, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:33:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86ECA106566B; Sun, 19 Aug 2012 10:33:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58FEB8FC08; Sun, 19 Aug 2012 10:33:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAXWH9070467; Sun, 19 Aug 2012 10:33:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAXW84070466; Sun, 19 Aug 2012 10:33:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208191033.q7JAXW84070466@svn.freebsd.org> From: Dimitry Andric Date: Sun, 19 Aug 2012 10:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239393 - vendor/clang/clang-trunk-r162107 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 10:33:32 -0000 Author: dim Date: Sun Aug 19 10:33:31 2012 New Revision: 239393 URL: http://svn.freebsd.org/changeset/base/239393 Log: Tag clang trunk r162107. Added: vendor/clang/clang-trunk-r162107/ - copied from r239392, vendor/clang/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 10:34:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6703D106566B; Sun, 19 Aug 2012 10:34:41 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC5F8FC2C; Sun, 19 Aug 2012 10:34:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JAYfl2070632; Sun, 19 Aug 2012 10:34:41 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JAYfUK070629; Sun, 19 Aug 2012 10:34:41 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201208191034.q7JAYfUK070629@svn.freebsd.org> From: Martin Matuska Date: Sun, 19 Aug 2012 10:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239394 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 10:34:41 -0000 Author: mm Date: Sun Aug 19 10:34:40 2012 New Revision: 239394 URL: http://svn.freebsd.org/changeset/base/239394 Log: Update zfs(8) manpage with illumos version of "zfs diff" Illumos issue: 2399 zfs manual page does not document use of "zfs diff" References: https://www.illumos.org/issues/2399 PR: docs/170764 Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Aug 19 10:33:31 2012 (r239393) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Aug 19 10:34:40 2012 (r239394) @@ -2480,6 +2480,8 @@ also have the 'create' ability and 'moun .Xc .It create Ta subcommand Ta Must also have the 'mount' ability .It destroy Ta subcommand Ta Must also have the 'mount' ability +.It diff Ta subcommand Ta Allows lookup of paths within a dataset given an +object number, and the ability to create snapshots necessary to 'zfs diff' .It hold Ta subcommand Ta Allows adding a user hold to a snapshot .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets .It Xo promote Ta subcommand Ta Must @@ -2683,43 +2685,43 @@ descendent file systems. .Op Ar snapshot Ns | Ns Ar filesystem .Xc .Pp -Describes differences between a snapshot and a successor dataset. The -successor dataset can be a later snapshot or the current filesystem. -.Pp -The changed files are displayed including the change type. The change type -is displayed useing a single character. If a file or directory was renamed, -the old and the new names are displayed. -.Pp -The following change types can be displayed: -.Pp -.Bl -column -offset indent "CHARACTER" "CHANGE TYPE" -.It CHARACTER Ta CHANGE TYPE -.It \&+ Ta file was added -.It \&- Ta file was removed -.It \&M Ta file was modified -.It \&R Ta file was renamed +Display the difference between a snapshot of a given filesystem and another +snapshot of that filesystem from a later time or the current contents of the +filesystem. The first column is a character indicating the type of change, +the other columns indicate pathname, new pathname +.Pq in case of rename , +change in link count, and optionally file type and/or change time. +.Pp +The types of change are: +.Bl -column -offset 2n indent +.It \&- Ta path was removed +.It \&+ Ta path was added +.It \&M Ta path was modified +.It \&R Ta path was renamed .El .Bl -tag -width indent .It Fl F -Display a single letter for the file type in second to last column. -.Pp -The following file types can be displayed: +Display an indication of the type of file, in a manner similar to the +.Fl F +option of +.Xr ls 1 . .Pp -.Bl -column -offset indent "CHARACTER" "FILE TYPE" -.It CHARACTER Ta FILE TYPE -.It \&F Ta file -.It \&/ Ta directory +.Bl -column -offset 2n indent .It \&B Ta block device +.It \&C Ta character device +.It \&F Ta regular file +.It \&/ Ta directory .It \&@ Ta symbolic link .It \&= Ta socket .It \&> Ta door (not supported on Fx ) -.It \&| Ta FIFO (not supported on Fx ) -.It \&P Ta event portal (not supported on Fx ) +.It \&| Ta named pipe (not supported on Fx ) +.It \&P Ta event port (not supported on Fx ) .El .It Fl H -Machine-parseable output, fields separated a tab character. +Give more parseable tab-separated output, without header lines and without +arrows. .It Fl t -Display a change timestamp in the first column. +Display the path's inode change time as the first column of output. .El .It Xo .Nm @@ -3171,6 +3173,22 @@ Local+Descendent permissions on (tank/us group staff @pset,create,mount ------------------------------------------------------------- .Ed +.It Sy Example 22 Showing the differences between a snapshot and a ZFS Dataset +.Pp +The following example shows how to see what has changed between a prior +snapshot of a ZFS Dataset and its current state. The +.Fl F +option is used to indicate type information for the files affected. +.Pp +.Bd -literal -offset 2n +.Li # Ic zfs diff tank/test@before tank/test +M / /tank/test/ +M F /tank/test/linked (+1) +R F /tank/test/oldname -> /tank/test/newname +- F /tank/test/deleted ++ F /tank/test/created +M F /tank/test/modified +.Ed .El .Sh EXIT STATUS The following exit values are returned: From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 11:54:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10FFC106564A; Sun, 19 Aug 2012 11:54:03 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFC008FC08; Sun, 19 Aug 2012 11:54:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JBs2dA078817; Sun, 19 Aug 2012 11:54:02 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JBs2hc078815; Sun, 19 Aug 2012 11:54:02 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201208191154.q7JBs2hc078815@svn.freebsd.org> From: Randall Stewart Date: Sun, 19 Aug 2012 11:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239395 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 11:54:03 -0000 Author: rrs Date: Sun Aug 19 11:54:02 2012 New Revision: 239395 URL: http://svn.freebsd.org/changeset/base/239395 Log: Though I disagree, I conceed to jhb & Rui. Note that we still have a problem with this whole structure of locks and in_input.c [it does not lock which it should not, but this *can* lead to crashes]. (I have seen it in our SQA testbed.. besides the one with a refcnt issue that I will have SQA work on next week ;-) Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Aug 19 10:34:40 2012 (r239394) +++ head/sys/netinet/in.c Sun Aug 19 11:54:02 2012 (r239395) @@ -573,6 +573,7 @@ in_control(struct socket *so, u_long cmd } TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); IF_ADDR_WUNLOCK(ifp); + ifa_free(&ia->ia_ifa); /* if_addrhead */ IN_IFADDR_WLOCK(); TAILQ_REMOVE(&V_in_ifaddrhead, ia, ia_link); @@ -596,7 +597,6 @@ in_control(struct socket *so, u_long cmd } else ifa_free(&iap->ia_ifa); - ifa_free(&ia->ia_ifa); /* if_addrhead */ ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ out: if (ia != NULL) From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 11:58:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D9C6106566C; Sun, 19 Aug 2012 11:58:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4D91D8FC18; Sun, 19 Aug 2012 11:58:08 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 773F446B0A; Sun, 19 Aug 2012 07:58:02 -0400 (EDT) Date: Sun, 19 Aug 2012 12:58:02 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Randall Stewart In-Reply-To: <201208191154.q7JBs2hc078815@svn.freebsd.org> Message-ID: References: <201208191154.q7JBs2hc078815@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r239395 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 11:58:08 -0000 On Sun, 19 Aug 2012, Randall Stewart wrote: > Though I disagree, I conceed to jhb & Rui. Note > that we still have a problem with this whole structure of > locks and in_input.c [it does not lock which it should not, but > this *can* lead to crashes]. (I have seen it in our SQA > testbed.. besides the one with a refcnt issue that I will > have SQA work on next week ;-) I agree with John here -- these are seperate issues, and we need to get each part correct in isolation, not just in composition. Bjoern and I have been plotting a lock reduction exercise in the network stack for some time, based on a model Jeff Roberson and the Nokia guys used -- a global "config" lock, which would use our rmlock primitive. This would make address list synchronisation sufficiently affordable to use in ip_input(). However, it comes with a number of other issues that we need to consider, such as potential latency impacts of reconfiguration events, which have to be characterised before we commit to it, as well as potential issues with lock order. Recent rmlock improvements (e.g., with respect to WITNESS) make doing this work much more plausible. Hopefully this is something we'll get to in September. Robert From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 12:15:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C713C106564A; Sun, 19 Aug 2012 12:15:58 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from smtp01-out.isp.tdc.no (smtp01-out.isp.tdc.no [85.19.210.243]) by mx1.freebsd.org (Postfix) with ESMTP id 6074F8FC12; Sun, 19 Aug 2012 12:15:58 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [85.19.79.136]) by smtp01-out.isp.tdc.no (Postfix) with ESMTP id 3X0HD20wDFz39F; Sun, 19 Aug 2012 14:15:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bitfrost.no From: =?windows-1252?Q?Hans_Petter_Selasky?= To: =?windows-1252?Q?Andrew_Turner?= Date: Sun, 19 Aug 2012 14:15:53 +0200 Mime-Version: 1.0 In-Reply-To: <20120819202622.6db6a8dd@fubar.geek.nz> References: <20120819202622.6db6a8dd@fubar.geek.nz> X-Priority: 3 (Normal) Message-Id: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "=?windows-1252?Q?svn-src-head=40freebsd.org?=" , "=?windows-1252?Q?svn-src-all=40freebsd.org?=" , "=?windows-1252?Q?src-committers=40freebsd.org?=" , =?windows-1252?Q?Hans_Petter_Selasky?= Subject: RE: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 12:15:58 -0000 Hi,=0D=0A=0D=0A=A0=0D=0A=0D=0AWhat exactly is the driver the USB mass sto= rage device is attached to=3F=0D=0A=0D=0A=A0=0D=0A=0D=0AAnd the problem i= s the same using the latest FreeBSD version from -current=3F=0D=0A=0D=0A=A0= =0D=0A=0D=0AYou are certain that all parts of the kernel were rebuilt=3F=0D= =0A=0D=0A=A0=0D=0A=0D=0AAnd you are certain that it has nothing to do wit= h the FreeBSD version bump which is also part of this change=3F=0D=0A=0D=0A= =A0=0D=0A=0D=0AProbably we should move this thread to -current @=0D=0A=0D= =0A=A0=0D=0A=0D=0A--HPS=0D=0A=A0=0D=0A-----Original message-----=0D=0AFro= m:Andrew Turner =0D=0ASent:Sun 19-08-2012 10:27=0D=0A= Subject:Re: svn commit: r239214 - in head/sys: dev/usb dev/usb/controller= sys=0D=0ATo:Hans Petter Selasky ;=20=0D= =0ACC:Hans Petter Selasky ; svn-src-head@freebsd.or= g; svn-src-all@freebsd.org; src-committers@freebsd.org;=20=0D=0AOn Sun, 1= 9 Aug 2012 09:39:11 +0200=0D=0AHans Petter Selasky =A0 wrote:=0D=0A=0D=0A> Hi,=0D=0A>=20=0D=0A> =A0=0D=0A>=20=0D=0A= > Have you stepped the versions=3F=0D=0AI did a binary search of the comm= its to find the revision that caused=0D=0Athe issue.=0D=0A=0D=0A> Are you= sure it is exactly this commit=3F=0D=0AI built with r239213 and the prob= lem went away, when I built with=0D=0Ar239214 it appeared again.=0D=0A=0D= =0AAndrew=0D=0A From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 17:39:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A487106566B; Sun, 19 Aug 2012 17:39:00 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from emx.nitro.dk (leto.nitro.dk [178.63.52.6]) by mx1.freebsd.org (Postfix) with ESMTP id D1D2B8FC22; Sun, 19 Aug 2012 17:38:59 +0000 (UTC) Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) by emx.nitro.dk (Postfix) with ESMTP id B8F342B43EA; Sun, 19 Aug 2012 17:38:58 +0000 (UTC) Received: from emx.nitro.dk ([127.0.1.2]) by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) (amavisd-new, port 10024) with LMTP id 08izfVxnYxyq; Sun, 19 Aug 2012 17:38:56 +0000 (UTC) Received: from [192.168.4.24] (unknown [89.100.2.68]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emx.nitro.dk (Postfix) with ESMTPSA id 3E9DC2B43E5; Sun, 19 Aug 2012 17:38:56 +0000 (UTC) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) From: "Simon L. B. Nielsen" In-Reply-To: Date: Sun, 19 Aug 2012 18:38:55 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <38287857-28FA-4042-911D-EE0DDC54D62F@FreeBSD.org> References: <201208180926.q7I9Qptp001696@svn.freebsd.org> To: Chris Rees X-Mailer: Apple Mail (2.1485) Cc: svn-src-head@freebsd.org, cvsadm@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Niclas Zeising Subject: Re: svn commit: r239364 - head/libexec/revnetgroup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 17:39:00 -0000 On 18 Aug 2012, at 13:01, Chris Rees wrote: > On 18 August 2012 12:58, Chris Rees wrote: >> On 18 August 2012 10:26, Niclas Zeising wrote: >>> Author: zeising (ports committer) >>=20 >> There's something wrong here-- shouldn't it say (ports, doc >> committer)? Looks like it's not checking doc/svnadmin/conf/access... >=20 > (replying to own message) >=20 > For example, Glen Barber appears correctly (and demonstrates that it > should be doc,ports committer): >=20 > = http://lists.freebsd.org/pipermail/svn-src-head/2012-August/039471.html The problem is that the access file exporter which the commit scripts = use for out of repo commits looks at /home/mail/*-access which are based = on CVS versions, and and doc isn't updated in CVS anymore newer = committers status isn't shown correctly. It's a TODO, but nobody has gotten around to fixing it yet. --=20 Simon L. B. Nielsen From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:17:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9D85106566B; Sun, 19 Aug 2012 19:17:55 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A43BC8FC08; Sun, 19 Aug 2012 19:17:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJHtFX024652; Sun, 19 Aug 2012 19:17:55 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJHtWO024650; Sun, 19 Aug 2012 19:17:55 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191917.q7JJHtWO024650@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239396 - head/gnu/usr.bin/gdb/arch/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 19:17:55 -0000 Author: andreast Date: Sun Aug 19 19:17:54 2012 New Revision: 239396 URL: http://svn.freebsd.org/changeset/base/239396 Log: Fix typo. Not a win in terms of functionality but in terms of completeness. Modified: head/gnu/usr.bin/gdb/arch/powerpc/config.h Modified: head/gnu/usr.bin/gdb/arch/powerpc/config.h ============================================================================== --- head/gnu/usr.bin/gdb/arch/powerpc/config.h Sun Aug 19 11:54:02 2012 (r239395) +++ head/gnu/usr.bin/gdb/arch/powerpc/config.h Sun Aug 19 19:17:54 2012 (r239396) @@ -175,7 +175,7 @@ /* nativefile */ #ifndef CROSS_DEBUGGER -#define GDB_NM_FILE config/ia64/nm-fbsd.h +#define GDB_NM_FILE config/powerpc/nm-fbsd.h #endif /* Define to 1 so gets a definition of anon_hdl. Works From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:31:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB2221065670; Sun, 19 Aug 2012 19:31:37 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F5B8FC0C; Sun, 19 Aug 2012 19:31:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJVb10026037; Sun, 19 Aug 2012 19:31:37 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJVbAe026035; Sun, 19 Aug 2012 19:31:37 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191931.q7JJVbAe026035@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239397 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 19:31:37 -0000 Author: andreast Date: Sun Aug 19 19:31:36 2012 New Revision: 239397 URL: http://svn.freebsd.org/changeset/base/239397 Log: Do the ADC init only at startup and not during every sensor read call. This reduces the number of interrupts. Modified: head/sys/dev/iicbus/ad7417.c Modified: head/sys/dev/iicbus/ad7417.c ============================================================================== --- head/sys/dev/iicbus/ad7417.c Sun Aug 19 19:17:54 2012 (r239396) +++ head/sys/dev/iicbus/ad7417.c Sun Aug 19 19:31:36 2012 (r239397) @@ -104,6 +104,7 @@ struct ad7417_softc { uint32_t sc_addr; struct ad7417_sensor *sc_sensors; int sc_nsensors; + int init_done; }; static device_method_t ad7417_methods[] = { /* Device interface */ @@ -247,6 +248,9 @@ ad7417_init_adc(device_t dev, uint32_t a { uint8_t buf; int err; + struct ad7417_softc *sc; + + sc = device_get_softc(dev); adc741x_config = 0; /* Clear Config2 */ @@ -267,6 +271,8 @@ ad7417_init_adc(device_t dev, uint32_t a if (err < 0) return (-1); + sc->init_done = 1; + return (0); } @@ -430,10 +436,10 @@ ad7417_attach(device_t dev) if (sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR) { unit = "temp"; - desc = "Sensor temp in C"; + desc = "sensor unit (C)"; } else { unit = "volt"; - desc = "Sensor Volt in V"; + desc = "sensor unit (mV)"; } /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -584,9 +590,10 @@ ad7417_sensor_read(struct ad7417_sensor sc = device_get_softc(sens->dev); - /* Init the ADC. */ - if (ad7417_init_adc(sc->sc_dev, sc->sc_addr) < 0) - return (-1); + /* Init the ADC if not already done.*/ + if (!sc->init_done) + if (ad7417_init_adc(sc->sc_dev, sc->sc_addr) < 0) + return (-1); if (sens->type == ADC7417_TEMP_SENSOR) { if (ad7417_get_temp(sc->sc_dev, sc->sc_addr, &temp) < 0) From owner-svn-src-all@FreeBSD.ORG Sun Aug 19 19:32:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 121F51065670; Sun, 19 Aug 2012 19:32:39 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F07628FC0C; Sun, 19 Aug 2012 19:32:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7JJWc1N026172; Sun, 19 Aug 2012 19:32:38 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7JJWcUn026170; Sun, 19 Aug 2012 19:32:38 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201208191932.q7JJWcUn026170@svn.freebsd.org> From: Andreas Tobler Date: Sun, 19 Aug 2012 19:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239398 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Aug 2012 19:32:39 -0000 Author: andreast Date: Sun Aug 19 19:32:38 2012 New Revision: 239398 URL: http