aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2012-06-29 15:24:55 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2012-06-29 15:24:55 +0000
commitc8cffe533d7789d9966d82e8617792618618d33f (patch)
tree627c93a1d7d627b7080c6583c5e52609e6dd9207 /usr.bin
parentcce32a52d5e5f347cbd9a73df6d3e4924f663f48 (diff)
downloadsrc-c8cffe533d7789d9966d82e8617792618618d33f.tar.gz
src-c8cffe533d7789d9966d82e8617792618618d33f.zip
MFC 236577:
Allow the -p argument to kdump to accept either a PID or a thread ID.
Notes
Notes: svn path=/stable/8/; revision=237790
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/kdump/kdump.16
-rw-r--r--usr.bin/kdump/kdump.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/kdump/kdump.1 b/usr.bin/kdump/kdump.1
index 76a40668240e..3ab650017d59 100644
--- a/usr.bin/kdump/kdump.1
+++ b/usr.bin/kdump/kdump.1
@@ -32,7 +32,7 @@
.\" @(#)kdump.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd April 20, 2012
+.Dd June 4, 2012
.Dt KDUMP 1
.Os
.Sh NAME
@@ -90,9 +90,9 @@ string.
Suppressing this feature yields a more consistent output format and is
easily amenable to further processing.
.It Fl p Ar pid
-Display only trace events that correspond to the process
+Display only trace events that correspond to the process or thread
.Ar pid .
-This may be useful when there are multiple processes recorded in the
+This may be useful when there are multiple processes or threads recorded in the
same trace file.
.It Fl R
Display relative timestamps (time since previous entry).
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index f5ce07f7e382..560b5c538178 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -253,7 +253,8 @@ main(int argc, char *argv[])
}
}
if (trpoints & (1<<ktr_header.ktr_type))
- if (pid == 0 || ktr_header.ktr_pid == pid)
+ if (pid == 0 || ktr_header.ktr_pid == pid ||
+ ktr_header.ktr_tid == pid)
dumpheader(&ktr_header);
if ((ktrlen = ktr_header.ktr_len) < 0)
errx(1, "bogus length 0x%x", ktrlen);
@@ -268,7 +269,8 @@ main(int argc, char *argv[])
if (fetchprocinfo(&ktr_header, (u_int *)m) != 0)
continue;
sv_flags = abidump(&ktr_header);
- if (pid && ktr_header.ktr_pid != pid)
+ if (pid && ktr_header.ktr_pid != pid &&
+ ktr_header.ktr_tid != pid)
continue;
if ((trpoints & (1<<ktr_header.ktr_type)) == 0)
continue;