blob: de8ba9d4eed54f3689414caad32f82e3b5bbe155 [file] [log] [blame]
Christopher Ferris20303f82014-01-10 16:33:16 -08001/*
2 * Copyright 2006, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080016
17#include <stdio.h>
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080018#include <errno.h>
19#include <signal.h>
20#include <pthread.h>
21#include <stdarg.h>
22#include <fcntl.h>
23#include <sys/types.h>
24#include <dirent.h>
Jeff Brown053b8652012-06-06 16:25:03 -070025#include <time.h>
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080026
27#include <sys/ptrace.h>
28#include <sys/wait.h>
Elliott Hughescac5d8c2014-01-10 14:40:53 -080029#include <elf.h>
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080030#include <sys/stat.h>
Jeff Brown9524e412011-10-24 11:10:16 -070031#include <sys/poll.h>
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080032
Colin Cross9227bd32013-07-23 16:59:20 -070033#include <log/logd.h>
34#include <log/logger.h>
35
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080036#include <cutils/sockets.h>
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080037#include <cutils/properties.h>
Jeff Brown053b8652012-06-06 16:25:03 -070038#include <cutils/debugger.h>
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080039
40#include <linux/input.h>
41
42#include <private/android_filesystem_config.h>
43
Jeff Brown053b8652012-06-06 16:25:03 -070044#include "backtrace.h"
Jeff Brown13e715b2011-10-21 12:14:56 -070045#include "getevent.h"
Jeff Brown053b8652012-06-06 16:25:03 -070046#include "tombstone.h"
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080047#include "utility.h"
48
Jeff Brown053b8652012-06-06 16:25:03 -070049typedef struct {
Christopher Ferris20303f82014-01-10 16:33:16 -080050 debugger_action_t action;
51 pid_t pid, tid;
52 uid_t uid, gid;
53 uintptr_t abort_msg_address;
Jeff Brown053b8652012-06-06 16:25:03 -070054} debugger_request_t;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080055
Christopher Ferris20303f82014-01-10 16:33:16 -080056static int write_string(const char* file, const char* string) {
57 int len;
58 int fd;
59 ssize_t amt;
60 fd = open(file, O_RDWR);
61 len = strlen(string);
62 if (fd < 0)
63 return -errno;
64 amt = write(fd, string, len);
65 close(fd);
66 return amt >= 0 ? 0 : -errno;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080067}
68
Christopher Ferris20303f82014-01-10 16:33:16 -080069static void init_debug_led() {
70 // trout leds
71 write_string("/sys/class/leds/red/brightness", "0");
72 write_string("/sys/class/leds/green/brightness", "0");
73 write_string("/sys/class/leds/blue/brightness", "0");
74 write_string("/sys/class/leds/red/device/blink", "0");
75 // sardine leds
76 write_string("/sys/class/leds/left/cadence", "0,0");
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080077}
78
Christopher Ferris20303f82014-01-10 16:33:16 -080079static void enable_debug_led() {
80 // trout leds
81 write_string("/sys/class/leds/red/brightness", "255");
82 // sardine leds
83 write_string("/sys/class/leds/left/cadence", "1,0");
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080084}
85
Christopher Ferris20303f82014-01-10 16:33:16 -080086static void disable_debug_led() {
87 // trout leds
88 write_string("/sys/class/leds/red/brightness", "0");
89 // sardine leds
90 write_string("/sys/class/leds/left/cadence", "0,0");
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080091}
92
Jeff Brown9524e412011-10-24 11:10:16 -070093static void wait_for_user_action(pid_t pid) {
Christopher Ferris20303f82014-01-10 16:33:16 -080094 // First log a helpful message
95 LOG( "********************************************************\n"
96 "* Process %d has been suspended while crashing. To\n"
97 "* attach gdbserver for a gdb connection on port 5039\n"
98 "* and start gdbclient:\n"
99 "*\n"
100 "* gdbclient app_process :5039 %d\n"
101 "*\n"
102 "* Wait for gdb to start, then press HOME or VOLUME DOWN key\n"
103 "* to let the process continue crashing.\n"
104 "********************************************************\n",
105 pid, pid);
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800106
Christopher Ferris20303f82014-01-10 16:33:16 -0800107 // wait for HOME or VOLUME DOWN key
108 if (init_getevent() == 0) {
109 int ms = 1200 / 10;
110 int dit = 1;
111 int dah = 3*dit;
112 int _ = -dit;
113 int ___ = 3*_;
114 int _______ = 7*_;
115 const int codes[] = {
116 dit,_,dit,_,dit,___,dah,_,dah,_,dah,___,dit,_,dit,_,dit,_______
117 };
118 size_t s = 0;
119 struct input_event e;
120 bool done = false;
121 init_debug_led();
122 enable_debug_led();
123 do {
124 int timeout = abs(codes[s]) * ms;
125 int res = get_event(&e, timeout);
126 if (res == 0) {
127 if (e.type == EV_KEY
128 && (e.code == KEY_HOME || e.code == KEY_VOLUMEDOWN)
129 && e.value == 0) {
130 done = true;
131 }
132 } else if (res == 1) {
133 if (++s >= sizeof(codes)/sizeof(*codes))
134 s = 0;
135 if (codes[s] > 0) {
136 enable_debug_led();
137 } else {
138 disable_debug_led();
139 }
140 }
141 } while (!done);
142 uninit_getevent();
143 }
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800144
Christopher Ferris20303f82014-01-10 16:33:16 -0800145 // don't forget to turn debug led off
146 disable_debug_led();
147 LOG("debuggerd resuming process %d", pid);
Jeff Brown9524e412011-10-24 11:10:16 -0700148}
Ben Cheng09e71372009-09-28 11:06:09 -0700149
Jeff Brown9524e412011-10-24 11:10:16 -0700150static int get_process_info(pid_t tid, pid_t* out_pid, uid_t* out_uid, uid_t* out_gid) {
Christopher Ferris20303f82014-01-10 16:33:16 -0800151 char path[64];
152 snprintf(path, sizeof(path), "/proc/%d/status", tid);
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800153
Christopher Ferris20303f82014-01-10 16:33:16 -0800154 FILE* fp = fopen(path, "r");
155 if (!fp) {
156 return -1;
157 }
Jeff Brown9524e412011-10-24 11:10:16 -0700158
Christopher Ferris20303f82014-01-10 16:33:16 -0800159 int fields = 0;
160 char line[1024];
161 while (fgets(line, sizeof(line), fp)) {
162 size_t len = strlen(line);
163 if (len > 6 && !memcmp(line, "Tgid:\t", 6)) {
164 *out_pid = atoi(line + 6);
165 fields |= 1;
166 } else if (len > 5 && !memcmp(line, "Uid:\t", 5)) {
167 *out_uid = atoi(line + 5);
168 fields |= 2;
169 } else if (len > 5 && !memcmp(line, "Gid:\t", 5)) {
170 *out_gid = atoi(line + 5);
171 fields |= 4;
Jeff Brown9524e412011-10-24 11:10:16 -0700172 }
Christopher Ferris20303f82014-01-10 16:33:16 -0800173 }
174 fclose(fp);
175 return fields == 7 ? 0 : -1;
Jeff Brown9524e412011-10-24 11:10:16 -0700176}
177
Jeff Brown053b8652012-06-06 16:25:03 -0700178static int read_request(int fd, debugger_request_t* out_request) {
Christopher Ferris20303f82014-01-10 16:33:16 -0800179 struct ucred cr;
180 int len = sizeof(cr);
181 int status = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
182 if (status != 0) {
183 LOG("cannot get credentials\n");
184 return -1;
185 }
186
187 XLOG("reading tid\n");
188 fcntl(fd, F_SETFL, O_NONBLOCK);
189
190 struct pollfd pollfds[1];
191 pollfds[0].fd = fd;
192 pollfds[0].events = POLLIN;
193 pollfds[0].revents = 0;
194 status = TEMP_FAILURE_RETRY(poll(pollfds, 1, 3000));
195 if (status != 1) {
196 LOG("timed out reading tid (from pid=%d uid=%d)\n", cr.pid, cr.uid);
197 return -1;
198 }
199
200 debugger_msg_t msg;
201 memset(&msg, 0, sizeof(msg));
202 status = TEMP_FAILURE_RETRY(read(fd, &msg, sizeof(msg)));
203 if (status < 0) {
204 LOG("read failure? %s (pid=%d uid=%d)\n", strerror(errno), cr.pid, cr.uid);
205 return -1;
206 }
207 if (status == sizeof(debugger_msg_t)) {
208 XLOG("crash request of size %d abort_msg_address=%#08x\n", status, msg.abort_msg_address);
209 } else {
210 LOG("invalid crash request of size %d (from pid=%d uid=%d)\n", status, cr.pid, cr.uid);
211 return -1;
212 }
213
214 out_request->action = msg.action;
215 out_request->tid = msg.tid;
216 out_request->pid = cr.pid;
217 out_request->uid = cr.uid;
218 out_request->gid = cr.gid;
219 out_request->abort_msg_address = msg.abort_msg_address;
220
221 if (msg.action == DEBUGGER_ACTION_CRASH) {
222 // Ensure that the tid reported by the crashing process is valid.
223 char buf[64];
224 struct stat s;
225 snprintf(buf, sizeof buf, "/proc/%d/task/%d", out_request->pid, out_request->tid);
226 if (stat(buf, &s)) {
227 LOG("tid %d does not exist in pid %d. ignoring debug request\n",
228 out_request->tid, out_request->pid);
229 return -1;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800230 }
Christopher Ferris20303f82014-01-10 16:33:16 -0800231 } else if (cr.uid == 0
Jeff Brown053b8652012-06-06 16:25:03 -0700232 || (cr.uid == AID_SYSTEM && msg.action == DEBUGGER_ACTION_DUMP_BACKTRACE)) {
Christopher Ferris20303f82014-01-10 16:33:16 -0800233 // Only root or system can ask us to attach to any process and dump it explicitly.
234 // However, system is only allowed to collect backtraces but cannot dump tombstones.
235 status = get_process_info(out_request->tid, &out_request->pid,
236 &out_request->uid, &out_request->gid);
237 if (status < 0) {
238 LOG("tid %d does not exist. ignoring explicit dump request\n", out_request->tid);
239 return -1;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800240 }
Christopher Ferris20303f82014-01-10 16:33:16 -0800241 } else {
242 // No one else is allowed to dump arbitrary processes.
243 return -1;
244 }
245 return 0;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800246}
247
Jeff Brown053b8652012-06-06 16:25:03 -0700248static bool should_attach_gdb(debugger_request_t* request) {
Christopher Ferris20303f82014-01-10 16:33:16 -0800249 if (request->action == DEBUGGER_ACTION_CRASH) {
250 char value[PROPERTY_VALUE_MAX];
251 property_get("debug.db.uid", value, "-1");
252 int debug_uid = atoi(value);
253 return debug_uid >= 0 && request->uid <= (uid_t)debug_uid;
254 }
255 return false;
Jeff Brown9524e412011-10-24 11:10:16 -0700256}
Bruce Beare84924902010-10-13 14:21:30 -0700257
Jeff Brown9524e412011-10-24 11:10:16 -0700258static void handle_request(int fd) {
Christopher Ferris20303f82014-01-10 16:33:16 -0800259 XLOG("handle_request(%d)\n", fd);
Jeff Brown9524e412011-10-24 11:10:16 -0700260
Christopher Ferris20303f82014-01-10 16:33:16 -0800261 debugger_request_t request;
262 memset(&request, 0, sizeof(request));
263 int status = read_request(fd, &request);
264 if (!status) {
265 XLOG("BOOM: pid=%d uid=%d gid=%d tid=%d\n",
266 request.pid, request.uid, request.gid, request.tid);
Jeff Brown9524e412011-10-24 11:10:16 -0700267
Christopher Ferris20303f82014-01-10 16:33:16 -0800268 // At this point, the thread that made the request is blocked in
269 // a read() call. If the thread has crashed, then this gives us
270 // time to PTRACE_ATTACH to it before it has a chance to really fault.
271 //
272 // The PTRACE_ATTACH sends a SIGSTOP to the target process, but it
273 // won't necessarily have stopped by the time ptrace() returns. (We
274 // currently assume it does.) We write to the file descriptor to
275 // ensure that it can run as soon as we call PTRACE_CONT below.
276 // See details in bionic/libc/linker/debugger.c, in function
277 // debugger_signal_handler().
278 if (ptrace(PTRACE_ATTACH, request.tid, 0, 0)) {
279 LOG("ptrace attach failed: %s\n", strerror(errno));
280 } else {
281 bool detach_failed = false;
282 bool attach_gdb = should_attach_gdb(&request);
283 if (TEMP_FAILURE_RETRY(write(fd, "\0", 1)) != 1) {
284 LOG("failed responding to client: %s\n", strerror(errno));
285 } else {
286 char* tombstone_path = NULL;
Jeff Brownfb9804b2011-11-08 20:17:05 -0800287
Christopher Ferris20303f82014-01-10 16:33:16 -0800288 if (request.action == DEBUGGER_ACTION_CRASH) {
289 close(fd);
290 fd = -1;
Jeff Brown9524e412011-10-24 11:10:16 -0700291 }
292
Christopher Ferris20303f82014-01-10 16:33:16 -0800293 int total_sleep_time_usec = 0;
294 for (;;) {
295 int signal = wait_for_signal(request.tid, &total_sleep_time_usec);
296 if (signal < 0) {
297 break;
298 }
299
300 switch (signal) {
301 case SIGSTOP:
302 if (request.action == DEBUGGER_ACTION_DUMP_TOMBSTONE) {
303 XLOG("stopped -- dumping to tombstone\n");
304 tombstone_path = engrave_tombstone(
305 request.pid, request.tid, signal, request.abort_msg_address, true, true,
306 &detach_failed, &total_sleep_time_usec);
307 } else if (request.action == DEBUGGER_ACTION_DUMP_BACKTRACE) {
308 XLOG("stopped -- dumping to fd\n");
309 dump_backtrace(fd, -1, request.pid, request.tid, &detach_failed,
310 &total_sleep_time_usec);
311 } else {
312 XLOG("stopped -- continuing\n");
313 status = ptrace(PTRACE_CONT, request.tid, 0, 0);
314 if (status) {
315 LOG("ptrace continue failed: %s\n", strerror(errno));
316 }
317 continue; // loop again
318 }
319 break;
320
321 case SIGILL:
322 case SIGABRT:
323 case SIGBUS:
324 case SIGFPE:
325 case SIGSEGV:
326 case SIGPIPE:
327#ifdef SIGSTKFLT
328 case SIGSTKFLT:
329#endif
330 XLOG("stopped -- fatal signal\n");
331 // Send a SIGSTOP to the process to make all of
332 // the non-signaled threads stop moving. Without
333 // this we get a lot of "ptrace detach failed:
334 // No such process".
335 kill(request.pid, SIGSTOP);
336 // don't dump sibling threads when attaching to GDB because it
337 // makes the process less reliable, apparently...
338 tombstone_path = engrave_tombstone(
339 request.pid, request.tid, signal, request.abort_msg_address, !attach_gdb,
340 false, &detach_failed, &total_sleep_time_usec);
341 break;
342
343 default:
344 XLOG("stopped -- unexpected signal\n");
345 LOG("process stopped due to unexpected signal %d\n", signal);
346 break;
347 }
348 break;
349 }
350
351 if (request.action == DEBUGGER_ACTION_DUMP_TOMBSTONE) {
352 if (tombstone_path) {
353 write(fd, tombstone_path, strlen(tombstone_path));
354 }
355 close(fd);
356 fd = -1;
357 }
358 free(tombstone_path);
359 }
360
361 XLOG("detaching\n");
362 if (attach_gdb) {
363 // stop the process so we can debug
364 kill(request.pid, SIGSTOP);
365
366 // detach so we can attach gdbserver
367 if (ptrace(PTRACE_DETACH, request.tid, 0, 0)) {
368 LOG("ptrace detach from %d failed: %s\n", request.tid, strerror(errno));
369 detach_failed = true;
370 }
371
372 // if debug.db.uid is set, its value indicates if we should wait
373 // for user action for the crashing process.
374 // in this case, we log a message and turn the debug LED on
375 // waiting for a gdb connection (for instance)
376 wait_for_user_action(request.pid);
377 } else {
378 // just detach
379 if (ptrace(PTRACE_DETACH, request.tid, 0, 0)) {
380 LOG("ptrace detach from %d failed: %s\n", request.tid, strerror(errno));
381 detach_failed = true;
382 }
383 }
384
385 // resume stopped process (so it can crash in peace).
386 kill(request.pid, SIGCONT);
387
388 // If we didn't successfully detach, we're still the parent, and the
389 // actual parent won't receive a death notification via wait(2). At this point
390 // there's not much we can do about that.
391 if (detach_failed) {
392 LOG("debuggerd committing suicide to free the zombie!\n");
393 kill(getpid(), SIGKILL);
394 }
Jeff Brown9524e412011-10-24 11:10:16 -0700395 }
Christopher Ferris20303f82014-01-10 16:33:16 -0800396
397 }
398 if (fd >= 0) {
399 close(fd);
400 }
Jeff Brown9524e412011-10-24 11:10:16 -0700401}
402
403static int do_server() {
Christopher Ferris20303f82014-01-10 16:33:16 -0800404 int s;
405 struct sigaction act;
406 int logsocket = -1;
Ben Cheng09e71372009-09-28 11:06:09 -0700407
Christopher Ferris20303f82014-01-10 16:33:16 -0800408 // debuggerd crashes can't be reported to debuggerd. Reset all of the
409 // crash handlers.
410 signal(SIGILL, SIG_DFL);
411 signal(SIGABRT, SIG_DFL);
412 signal(SIGBUS, SIG_DFL);
413 signal(SIGFPE, SIG_DFL);
414 signal(SIGSEGV, SIG_DFL);
Chris Dearman231e3c82012-08-10 17:06:20 -0700415#ifdef SIGSTKFLT
Christopher Ferris20303f82014-01-10 16:33:16 -0800416 signal(SIGSTKFLT, SIG_DFL);
Chris Dearman231e3c82012-08-10 17:06:20 -0700417#endif
Andy McFadden44e12ec2011-07-29 12:36:47 -0700418
Christopher Ferris20303f82014-01-10 16:33:16 -0800419 // Ignore failed writes to closed sockets
420 signal(SIGPIPE, SIG_IGN);
Nick Kralevich96bcd482013-06-18 17:57:08 -0700421
Christopher Ferris20303f82014-01-10 16:33:16 -0800422 logsocket = socket_local_client("logd", ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_DGRAM);
423 if (logsocket < 0) {
424 logsocket = -1;
425 } else {
426 fcntl(logsocket, F_SETFD, FD_CLOEXEC);
427 }
428
429 act.sa_handler = SIG_DFL;
430 sigemptyset(&act.sa_mask);
431 sigaddset(&act.sa_mask,SIGCHLD);
432 act.sa_flags = SA_NOCLDWAIT;
433 sigaction(SIGCHLD, &act, 0);
434
435 s = socket_local_server(DEBUGGER_SOCKET_NAME, ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_STREAM);
436 if (s < 0)
437 return 1;
438 fcntl(s, F_SETFD, FD_CLOEXEC);
439
440 LOG("debuggerd: " __DATE__ " " __TIME__ "\n");
441
442 for (;;) {
443 struct sockaddr addr;
444 socklen_t alen;
445 int fd;
446
447 alen = sizeof(addr);
448 XLOG("waiting for connection\n");
449 fd = accept(s, &addr, &alen);
450 if (fd < 0) {
451 XLOG("accept failed: %s\n", strerror(errno));
452 continue;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800453 }
454
Christopher Ferris20303f82014-01-10 16:33:16 -0800455 fcntl(fd, F_SETFD, FD_CLOEXEC);
Ben Cheng09e71372009-09-28 11:06:09 -0700456
Christopher Ferris20303f82014-01-10 16:33:16 -0800457 handle_request(fd);
458 }
459 return 0;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800460}
Jeff Brown9524e412011-10-24 11:10:16 -0700461
Jeff Brown053b8652012-06-06 16:25:03 -0700462static int do_explicit_dump(pid_t tid, bool dump_backtrace) {
Christopher Ferris20303f82014-01-10 16:33:16 -0800463 fprintf(stdout, "Sending request to dump task %d.\n", tid);
Jeff Brown9524e412011-10-24 11:10:16 -0700464
Christopher Ferris20303f82014-01-10 16:33:16 -0800465 if (dump_backtrace) {
466 fflush(stdout);
467 if (dump_backtrace_to_file(tid, fileno(stdout)) < 0) {
468 fputs("Error dumping backtrace.\n", stderr);
469 return 1;
Jeff Brown9524e412011-10-24 11:10:16 -0700470 }
Christopher Ferris20303f82014-01-10 16:33:16 -0800471 } else {
472 char tombstone_path[PATH_MAX];
473 if (dump_tombstone(tid, tombstone_path, sizeof(tombstone_path)) < 0) {
474 fputs("Error dumping tombstone.\n", stderr);
475 return 1;
476 }
477 fprintf(stderr, "Tombstone written to: %s\n", tombstone_path);
478 }
479 return 0;
Jeff Brown9524e412011-10-24 11:10:16 -0700480}
481
Jeff Brown053b8652012-06-06 16:25:03 -0700482static void usage() {
Christopher Ferris20303f82014-01-10 16:33:16 -0800483 fputs("Usage: -b [<tid>]\n"
484 " -b dump backtrace to console, otherwise dump full tombstone file\n"
485 "\n"
486 "If tid specified, sends a request to debuggerd to dump that task.\n"
487 "Otherwise, starts the debuggerd server.\n", stderr);
Jeff Brown053b8652012-06-06 16:25:03 -0700488}
489
Jeff Brown9524e412011-10-24 11:10:16 -0700490int main(int argc, char** argv) {
Christopher Ferris20303f82014-01-10 16:33:16 -0800491 if (argc == 1) {
492 return do_server();
493 }
Jeff Brown053b8652012-06-06 16:25:03 -0700494
Christopher Ferris20303f82014-01-10 16:33:16 -0800495 bool dump_backtrace = false;
496 bool have_tid = false;
497 pid_t tid = 0;
498 for (int i = 1; i < argc; i++) {
499 if (!strcmp(argv[i], "-b")) {
500 dump_backtrace = true;
501 } else if (!have_tid) {
502 tid = atoi(argv[i]);
503 have_tid = true;
504 } else {
505 usage();
506 return 1;
Jeff Brown9524e412011-10-24 11:10:16 -0700507 }
Christopher Ferris20303f82014-01-10 16:33:16 -0800508 }
509 if (!have_tid) {
510 usage();
511 return 1;
512 }
513 return do_explicit_dump(tid, dump_backtrace);
Jeff Brown9524e412011-10-24 11:10:16 -0700514}