Print this page
NEX-2787 Multiple comstar / fibre channel / qlt threads stuck waiting on locks with a spinning interrupt thread
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Approved by: Jean McCormack <jean.mccormack@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c
+++ new/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c
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 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
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.
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 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
23 24 * Use is subject to license terms.
24 25 */
25 26
26 27 /*
27 28 * Stubs for basic system services otherwise unavailable to the debugger.
28 29 */
29 30
30 31 #include <stdlib.h>
31 32 #include <unistd.h>
32 33 #include <libproc.h>
33 34 #include <sys/time.h>
34 35
35 36 #include <kmdb/kmdb_dpi.h>
36 37 #include <kmdb/kmdb_promif.h>
37 38 #include <kmdb/kmdb_io.h>
38 39 #include <mdb/mdb_debug.h>
39 40 #include <mdb/mdb_signal.h>
40 41 #include <mdb/mdb_io_impl.h>
41 42 #include <mdb/mdb.h>
42 43
43 44 /*ARGSUSED*/
44 45 char *
45 46 getenv(const char *name)
46 47 {
47 48 /* There aren't any environment variables here */
48 49 return (NULL);
49 50 }
50 51
51 52 char *
52 53 strerror(int errnum)
53 54 {
54 55 static char errnostr[16];
55 56
56 57 (void) mdb_snprintf(errnostr, sizeof (errnostr), "Error %d", errnum);
|
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
57 58
58 59 return (errnostr);
59 60 }
60 61
61 62 pid_t
62 63 getpid(void)
63 64 {
64 65 return (1);
65 66 }
66 67
68 +void
69 +__assert(const char *statement, const char *file, int line)
70 +{
71 + (void) mdb_printf("ASSERT at %s, File: %s, Line: %d\n",
72 + statement ? statement : "<empty>",
73 + file ? file : "<empty>", line);
74 + exit(1);
75 +}
76 +
67 77 /*
68 78 * We're trying to isolate ourselves from the rest of the world as much as
69 79 * possible, so we can't rely on the time in the kernel proper. For now, we
70 80 * just bump a counter whenever time is requested, thus guaranteeing that
71 81 * things with timestamps can be compared according to order of occurrance.
72 82 */
73 83 hrtime_t
74 84 gethrtime(void)
75 85 {
76 86 static hrtime_t kmdb_timestamp;
77 87
78 88 return (++kmdb_timestamp);
79 89 }
80 90
81 91 /*
82 92 * Signal handling
83 93 */
84 94
85 95 /*ARGSUSED*/
86 96 int
87 97 sigemptyset(sigset_t *set)
88 98 {
89 99 return (0);
90 100 }
91 101
92 102 /*ARGSUSED*/
93 103 int
94 104 sigaddset(sigset_t *set, int signo)
95 105 {
96 106 return (0);
97 107 }
98 108
99 109 /*ARGSUSED*/
100 110 int
101 111 sigfillset(sigset_t *set)
102 112 {
103 113 return (0);
104 114 }
105 115
106 116 /*ARGSUSED*/
107 117 int
108 118 sigprocmask(int how, const sigset_t *set, sigset_t *oset)
109 119 {
110 120 return (0);
111 121 }
112 122
113 123 /*ARGSUSED*/
114 124 int
115 125 sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
116 126 {
117 127 return (0);
118 128 }
119 129
120 130 /*ARGSUSED*/
121 131 int
122 132 kill(pid_t pid, int sig)
123 133 {
124 134 if (sig == SIGABRT) {
125 135 mdb_printf("Debugger aborted\n");
126 136 exit(1);
127 137 }
128 138
129 139 return (0);
130 140 }
131 141
132 142 /*ARGSUSED*/
133 143 int
134 144 proc_str2flt(const char *buf, int *ptr)
135 145 {
136 146 return (-1);
137 147 }
138 148
139 149 /*ARGSUSED*/
140 150 int
141 151 proc_str2sig(const char *buf, int *ptr)
142 152 {
143 153 return (-1);
144 154 }
145 155
146 156 /*ARGSUSED*/
147 157 int
148 158 proc_str2sys(const char *buf, int *ptr)
149 159 {
150 160 return (-1);
151 161 }
152 162
153 163 /*ARGSUSED*/
154 164 void
155 165 exit(int status)
156 166 {
157 167 #ifdef __sparc
158 168 extern void kmdb_prom_exit_to_mon(void) __NORETURN;
159 169
160 170 kmdb_prom_exit_to_mon();
161 171 #else
162 172 extern void kmdb_dpi_reboot(void) __NORETURN;
163 173 static int recurse = 0;
164 174
165 175 if (!recurse) {
166 176
167 177 recurse = 1;
168 178
169 179 mdb_iob_printf(mdb.m_out, "Press any key to reboot\n");
170 180 mdb_iob_flush(mdb.m_out);
171 181 mdb_iob_clearlines(mdb.m_out);
172 182
173 183 (void) kmdb_getchar();
174 184 }
175 185
176 186 kmdb_dpi_reboot();
177 187 #endif
178 188 }
|
↓ open down ↓ |
102 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX