changeset 13965:74a52e9ca211

3501 mdb: ::thread -d needs the SWITCH column Reviewed by: David Höppner <0xffea@gmail.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Richard Lowe <richlowe@richlowe.net>
author Marcel Telka <Marcel.Telka@nexenta.com>
date Tue, 19 Feb 2013 15:34:49 -0500
parents 2430752e824f
children 0e1d84ebb004
files usr/src/cmd/mdb/common/modules/genunix/thread.c
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/mdb/common/modules/genunix/thread.c	Tue Feb 19 15:34:48 2013 -0500
+++ b/usr/src/cmd/mdb/common/modules/genunix/thread.c	Tue Feb 19 15:34:49 2013 -0500
@@ -22,9 +22,13 @@
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 
 #include <mdb/mdb_modapi.h>
+#include <mdb/mdb_ks.h>
 #include <sys/types.h>
 #include <sys/thread.h>
 #include <sys/lwp.h>
@@ -466,8 +470,8 @@
 
 		if (oflags & TF_DISP) {
 			SPACER();
-			mdb_printf("%<u> %?s %5s %2s%</u>",
-			    "DISPTIME", "BOUND", "PR");
+			mdb_printf("%<u> %?s %5s %2s %-6s%</u>",
+			    "DISPTIME", "BOUND", "PR", "SWITCH");
 		}
 		mdb_printf("\n");
 	}
@@ -523,8 +527,13 @@
 	/* dispatcher stuff */
 	if (oflags & TF_DISP) {
 		SPACER();
-		mdb_printf(" %?lx %5d %2d",
+		mdb_printf(" %?lx %5d %2d ",
 		    t.t_disp_time, t.t_bind_cpu, t.t_preempt);
+		if (t.t_disp_time != 0)
+			mdb_printf("t-%-4d",
+			    (clock_t)mdb_get_lbolt() - t.t_disp_time);
+		else
+			mdb_printf("%-6s", "-");
 	}
 
 	mdb_printf("\n");