From owner-svn-src-vendor@FreeBSD.ORG Sun Aug 19 09:17:21 2012
Return-Path:
Delivered-To: svn-src-vendor@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-vendor@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
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-vendor@FreeBSD.ORG Sun Aug 19 09:20:24 2012
Return-Path:
Delivered-To: svn-src-vendor@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-vendor@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
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-vendor@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-vendor@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
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-vendor@FreeBSD.ORG Sun Aug 19 09:30:59 2012
Return-Path:
Delivered-To: svn-src-vendor@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-vendor@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
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-vendor@FreeBSD.ORG Sun Aug 19 09:34:04 2012
Return-Path:
Delivered-To: svn-src-vendor@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-vendor@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
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-vendor@FreeBSD.ORG Sun Aug 19 10:31:52 2012
Return-Path:
Delivered-To: svn-src-vendor@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-vendor@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
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-vendor@FreeBSD.ORG Sun Aug 19 10:32:33 2012
Return-Path:
Delivered-To: svn-src-vendor@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-vendor@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
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-vendor@FreeBSD.ORG Sun Aug 19 10:33:06 2012
Return-Path:
Delivered-To: svn-src-vendor@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-vendor@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the vendor work area tree
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
+
+
+
+
+