Print this page
12385 tst.subr.d needs fixing for NULL as a pointer
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/dtrace/test/tst/common/aggs/tst.subr.d
+++ new/usr/src/cmd/dtrace/test/tst/common/aggs/tst.subr.d
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 - * Copyright (c) 2012, Joyent, Inc. All rights reserved.
25 + * Copyright 2020 Joyent, Inc.
26 26 */
27 27
28 28 #include <sys/dtrace.h>
29 29
30 30 #define INTFUNC(x) \
31 31 BEGIN \
32 32 /*DSTYLED*/ \
33 33 { \
34 34 subr++; \
35 35 @[(long)x] = sum(1); \
36 36 /*DSTYLED*/ \
37 37 }
38 38
39 39 #define STRFUNC(x) \
40 40 BEGIN \
41 41 /*DSTYLED*/ \
42 42 { \
43 43 subr++; \
44 44 @str[x] = sum(1); \
45 45 /*DSTYLED*/ \
46 46 }
47 47
48 48 #define VOIDFUNC(x) \
49 49 BEGIN \
50 50 /*DSTYLED*/ \
51 51 { \
52 52 subr++; \
53 53 /*DSTYLED*/ \
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
54 54 }
55 55
56 56 INTFUNC(rand())
57 57 INTFUNC(mutex_owned(&`cpu_lock))
58 58 INTFUNC(mutex_owner(&`cpu_lock))
59 59 INTFUNC(mutex_type_adaptive(&`cpu_lock))
60 60 INTFUNC(mutex_type_spin(&`cpu_lock))
61 61 INTFUNC(rw_read_held(&`vfssw_lock))
62 62 INTFUNC(rw_write_held(&`vfssw_lock))
63 63 INTFUNC(rw_iswriter(&`vfssw_lock))
64 -INTFUNC(copyin(NULL, 1))
65 -STRFUNC(copyinstr(NULL, 1))
64 +INTFUNC(copyin((uintptr_t)NULL, 1))
65 +STRFUNC(copyinstr((uintptr_t)NULL, 1))
66 66 INTFUNC(speculation())
67 67 INTFUNC(progenyof($pid))
68 68 INTFUNC(strlen("fooey"))
69 69 VOIDFUNC(copyout)
70 70 VOIDFUNC(copyoutstr)
71 71 INTFUNC(alloca(10))
72 72 VOIDFUNC(bcopy)
73 73 VOIDFUNC(copyinto)
74 74 INTFUNC(msgdsize(NULL))
75 75 INTFUNC(msgsize(NULL))
76 76 INTFUNC(getmajor(0))
77 77 INTFUNC(getminor(0))
78 78 STRFUNC(ddi_pathname(NULL, 0))
79 79 STRFUNC(strjoin("foo", "bar"))
80 80 STRFUNC(lltostr(12373))
81 81 STRFUNC(basename("/var/crash/systemtap"))
82 82 STRFUNC(dirname("/var/crash/systemtap"))
83 83 STRFUNC(cleanpath("/var/crash/systemtap"))
84 84 STRFUNC(strchr("The SystemTap, The.", 't'))
85 85 STRFUNC(strrchr("The SystemTap, The.", 't'))
86 86 STRFUNC(strstr("The SystemTap, The.", "The"))
87 87 STRFUNC(strtok("The SystemTap, The.", "T"))
88 88 STRFUNC(substr("The SystemTap, The.", 0))
89 89 INTFUNC(index("The SystemTap, The.", "The"))
90 90 INTFUNC(rindex("The SystemTap, The.", "The"))
91 91 INTFUNC(htons(0x1234))
92 92 INTFUNC(htonl(0x12345678))
93 93 INTFUNC(htonll(0x1234567890abcdefL))
94 94 INTFUNC(ntohs(0x1234))
95 95 INTFUNC(ntohl(0x12345678))
96 96 INTFUNC(ntohll(0x1234567890abcdefL))
97 97 STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t))))
98 98 STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
99 99 STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
100 100 STRFUNC(toupper("foo"))
101 101 STRFUNC(tolower("BAR"))
102 102 INTFUNC(getf(0))
103 103 INTFUNC(strtoll("0x12EE5D5", 16))
104 104 STRFUNC(json("{\"systemtap\": false}", "systemtap"))
105 105
106 106 BEGIN
107 107 /subr == DIF_SUBR_MAX + 1/
108 108 {
109 109 exit(0);
110 110 }
111 111
112 112 BEGIN
113 113 {
114 114 printf("found %d subroutines, expected %d\n", subr, DIF_SUBR_MAX + 1);
115 115 exit(1);
116 116 }
↓ open down ↓ |
41 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX