summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ddb/db_ps.c')
-rw-r--r--sys/ddb/db_ps.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c
index f38c89f..76ab2c5 100644
--- a/sys/ddb/db_ps.c
+++ b/sys/ddb/db_ps.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <sys/cons.h>
#include <sys/jail.h>
#include <sys/kdb.h>
+#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/sysent.h>
#include <sys/systm.h>
@@ -302,6 +303,7 @@ DB_SHOW_COMMAND(thread, db_show_thread)
struct thread *td;
struct lock_object *lock;
bool comma;
+ int delta;
/* Determine which thread to examine. */
if (have_addr)
@@ -376,6 +378,16 @@ DB_SHOW_COMMAND(thread, db_show_thread)
td->td_wchan);
db_printf(" priority: %d\n", td->td_priority);
db_printf(" container lock: %s (%p)\n", lock->lo_name, lock);
+ if (td->td_swvoltick != 0) {
+ delta = (u_int)ticks - (u_int)td->td_swvoltick;
+ db_printf(" last voluntary switch: %d ms ago\n",
+ 1000 * delta / hz);
+ }
+ if (td->td_swinvoltick != 0) {
+ delta = (u_int)ticks - (u_int)td->td_swinvoltick;
+ db_printf(" last involuntary switch: %d ms ago\n",
+ 1000 * delta / hz);
+ }
}
DB_SHOW_COMMAND(proc, db_show_proc)
OpenPOWER on IntegriCloud