summaryrefslogtreecommitdiffstats
path: root/usr.bin/kdump
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-06-04 19:09:14 +0000
committerjhb <jhb@FreeBSD.org>2012-06-04 19:09:14 +0000
commit6c78422cc55423c6d023c8d5c85b2a445d2f1b14 (patch)
tree57467fa3ab3c01433d7ad8ec67c5837ee4f681e7 /usr.bin/kdump
parent682335a36dbe305f851b4c650e59ffcb1812bd40 (diff)
downloadFreeBSD-src-6c78422cc55423c6d023c8d5c85b2a445d2f1b14.zip
FreeBSD-src-6c78422cc55423c6d023c8d5c85b2a445d2f1b14.tar.gz
Allow the -p argument to kdump to accept either a PID or a thread ID.
Submitted by: Dmitry Banschikov d.banschikov hostcomm ru MFC after: 1 week
Diffstat (limited to 'usr.bin/kdump')
-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 0b4bcf4..f8e87e4 100644
--- a/usr.bin/kdump/kdump.1
+++ b/usr.bin/kdump/kdump.1
@@ -28,7 +28,7 @@
.\" @(#)kdump.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd April 20, 2012
+.Dd June 4, 2012
.Dt KDUMP 1
.Os
.Sh NAME
@@ -86,9 +86,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 57f5ce2..44ee14e 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -251,7 +251,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);
@@ -266,7 +267,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;
OpenPOWER on IntegriCloud