Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Dec 2003 18:47:35 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 43344 for review
Message-ID:  <200312030247.hB32lZu0096543@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=43344

Change 43344 by peter@peter_overcee on 2003/12/02 18:47:17

	capture this before I lose it too.  Add -E (elapsed) time stamps.
	This is IMHO more useful than both -R and/or -T.

Affected files ...

.. //depot/projects/hammer/usr.bin/kdump/kdump.1#3 edit
.. //depot/projects/hammer/usr.bin/kdump/kdump.c#6 edit

Differences ...

==== //depot/projects/hammer/usr.bin/kdump/kdump.1#3 (text+ko) ====

@@ -40,7 +40,7 @@
 .Nd display kernel trace data
 .Sh SYNOPSIS
 .Nm
-.Op Fl dnlRT
+.Op Fl dnlERT
 .Op Fl f Ar file
 .Op Fl m Ar maxdata
 .Op Fl p Ar pid
@@ -89,6 +89,8 @@
 .Ar pid .
 This may be useful when there are multiple processes recorded in the
 same trace file.
+.It Fl E
+Display elapsed timestamps (time since beginning of trace).
 .It Fl R
 Display relative timestamps (time since previous entry).
 .It Fl T

==== //depot/projects/hammer/usr.bin/kdump/kdump.c#6 (text+ko) ====

@@ -97,7 +97,7 @@
 
 	(void) setlocale(LC_CTYPE, "");
 
-	while ((ch = getopt(argc,argv,"f:dlm:np:RTt:")) != -1)
+	while ((ch = getopt(argc,argv,"f:dlm:np:ERTt:")) != -1)
 		switch((char)ch) {
 		case 'f':
 			tracefile = optarg;
@@ -117,6 +117,9 @@
 		case 'p':
 			pid = atoi(optarg);
 			break;
+		case 'E':
+			timestamp = 3;	/* elapsed timestamp */
+			break;
 		case 'R':
 			timestamp = 2;	/* relative timestamp */
 			break;
@@ -249,6 +252,11 @@
 
 	(void)printf("%6d %-8.*s ", kth->ktr_pid, MAXCOMLEN, kth->ktr_comm);
 	if (timestamp) {
+		if (timestamp == 3) {
+			if (prevtime.tv_sec == 0)
+				prevtime = kth->ktr_time;
+			timevalsub(&kth->ktr_time, &prevtime);
+		}
 		if (timestamp == 2) {
 			temp = kth->ktr_time;
 			timevalsub(&kth->ktr_time, &prevtime);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312030247.hB32lZu0096543>