Author: jhb
Date: Fri Jun 29 15:24:46 2012
New Revision: 237789
URL: http://svn.freebsd.org/changeset/base/237789

Log:
  MFC 236577:
  Allow the -p argument to kdump to accept either a PID or a thread ID.

Modified:
  stable/9/usr.bin/kdump/kdump.1
  stable/9/usr.bin/kdump/kdump.c
Directory Properties:
  stable/9/usr.bin/kdump/   (props changed)

Modified: stable/9/usr.bin/kdump/kdump.1
==============================================================================
--- stable/9/usr.bin/kdump/kdump.1      Fri Jun 29 15:24:42 2012        
(r237788)
+++ stable/9/usr.bin/kdump/kdump.1      Fri Jun 29 15:24:46 2012        
(r237789)
@@ -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).

Modified: stable/9/usr.bin/kdump/kdump.c
==============================================================================
--- stable/9/usr.bin/kdump/kdump.c      Fri Jun 29 15:24:42 2012        
(r237788)
+++ stable/9/usr.bin/kdump/kdump.c      Fri Jun 29 15:24:46 2012        
(r237789)
@@ -249,7 +249,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);
@@ -264,7 +265,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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to