diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-11-23 23:11:47 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-11-23 23:11:47 +0000 |
commit | 410699c6a25c48ffab6a3b08da24d9f056e6e788 (patch) | |
tree | 6b3cf07e1a3bccc8734cbd232e8228d3ab0bf4f8 /sys/ddb/db_command.c | |
parent | c628469f24c0ea0b0148a5ea9d584a2ececf9c68 (diff) | |
download | FreeBSD-src-410699c6a25c48ffab6a3b08da24d9f056e6e788.zip FreeBSD-src-410699c6a25c48ffab6a3b08da24d9f056e6e788.tar.gz |
When printing a stack trace for a thread, also print the pid and tid.
When a series of traces is included in a bug report, this will make it
easier to tie the trace information back to ps or threads output,
each of which will show the pid or the tid, but usually not both.
Diffstat (limited to 'sys/ddb/db_command.c')
-rw-r--r-- | sys/ddb/db_command.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index b1ad9e5..2e45a3d 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -630,6 +630,7 @@ db_stack_trace(db_expr_t tid, boolean_t hastid, db_expr_t count, char *modif) { struct thread *td; db_expr_t radix; + pid_t pid; int t; /* @@ -662,5 +663,10 @@ db_stack_trace(db_expr_t tid, boolean_t hastid, db_expr_t count, char *modif) } } else td = kdb_thread; + if (td->td_proc != NULL) + pid = td->td_proc->p_pid; + else + pid = -1; + db_printf("Tracing pid %d tid %ld td %p\n", pid, (long)td->td_tid, td); db_trace_thread(td, count); } |