summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-11-12 14:21:48 +0000
committerrwatson <rwatson@FreeBSD.org>2005-11-12 14:21:48 +0000
commitb52b6c93136bf42d011efb7a9cff015fe90c6a02 (patch)
treef00b5d0d89b26032f7109529e902a0df9f73ba68 /usr.bin
parente822237160f49937a020d391534382ab27cd4dc3 (diff)
downloadFreeBSD-src-b52b6c93136bf42d011efb7a9cff015fe90c6a02.zip
FreeBSD-src-b52b6c93136bf42d011efb7a9cff015fe90c6a02.tar.gz
Add "-s" argument to kdump to suppress the display of I/O data.
MFC after: 1 week
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/kdump/kdump.14
-rw-r--r--usr.bin/kdump/kdump.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/kdump/kdump.1 b/usr.bin/kdump/kdump.1
index 817f733..e89f478 100644
--- a/usr.bin/kdump/kdump.1
+++ b/usr.bin/kdump/kdump.1
@@ -40,7 +40,7 @@
.Nd display kernel trace data
.Sh SYNOPSIS
.Nm
-.Op Fl dEnlHRT
+.Op Fl dEnlHRsT
.Op Fl f Ar trfile
.Op Fl m Ar maxdata
.Op Fl p Ar pid
@@ -96,6 +96,8 @@ This may be useful when there are multiple processes recorded in the
same trace file.
.It Fl R
Display relative timestamps (time since previous entry).
+.It Fl s
+Suppress display of I/O data.
.It Fl T
Display absolute timestamps for each entry (seconds since epoch).
.It Fl t Ar cnisuw
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 14b940d..4a0ac31 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -81,7 +81,7 @@ void ktruser(int, unsigned char *);
void usage(void);
const char *ioctlname(u_long);
-int timestamp, decimal, fancy = 1, tail, threads, maxdata;
+int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata;
const char *tracefile = DEF_TRACEFILE;
struct ktr_header ktr_header;
@@ -98,7 +98,7 @@ main(int argc, char *argv[])
(void) setlocale(LC_CTYPE, "");
- while ((ch = getopt(argc,argv,"f:dElm:np:HRTt:")) != -1)
+ while ((ch = getopt(argc,argv,"f:dElm:np:HRsTt:")) != -1)
switch((char)ch) {
case 'f':
tracefile = optarg;
@@ -118,6 +118,9 @@ main(int argc, char *argv[])
case 'p':
pid = atoi(optarg);
break;
+ case 's':
+ suppressdata = 1;
+ break;
case 'E':
timestamp = 3; /* elapsed timestamp */
break;
@@ -538,6 +541,8 @@ ktrgenio(struct ktr_genio *ktr, int len)
printf("fd %d %s %d byte%s\n", ktr->ktr_fd,
ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen,
datalen == 1 ? "" : "s");
+ if (suppressdata)
+ return;
if (maxdata && datalen > maxdata)
datalen = maxdata;
@@ -599,6 +604,6 @@ void
usage(void)
{
(void)fprintf(stderr,
- "usage: kdump [-dEnlHRT] [-f trfile] [-m maxdata] [-p pid] [-t [cnisuw]]\n");
+ "usage: kdump [-dEnlHRsT] [-f trfile] [-m maxdata] [-p pid] [-t [cnisuw]]\n");
exit(1);
}
OpenPOWER on IntegriCloud