From d372186b525dd6c38a5a9d5d8a052f1f7a7aa75d Mon Sep 17 00:00:00 2001 From: jeff Date: Fri, 10 Jun 2005 23:21:29 +0000 Subject: - Add curthread to the state that ktr is saving. The extra information is well worth the bloat. - Change the formatting of 'show ktr' slightly to accommodate the additional field. Remove a tab from the verbose output and place the actual trace data after a : so it is more easy to understand which part is the event and which is part of the record. --- sys/kern/kern_ktr.c | 9 ++++++--- sys/sys/ktr.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index e23d972..b6d9098 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -221,6 +221,7 @@ ktr_tracepoint(u_int mask, const char *file, int line, const char *format, #endif entry->ktr_timestamp = KTR_TIME; entry->ktr_cpu = cpu; + entry->ktr_thread = curthread; if (file != NULL) while (strncmp(file, "../", 3) == 0) file += 3; @@ -305,14 +306,16 @@ db_mach_vtrace(void) db_printf("--- End of trace buffer ---\n"); return (0); } - db_printf("%d: ", tstate.cur); + db_printf("%d (%p", tstate.cur, kp->ktr_thread); #ifdef SMP - db_printf("cpu%d ", kp->ktr_cpu); + db_printf(":cpu%d", kp->ktr_cpu); #endif + db_printf(")"); if (db_ktr_verbose) { - db_printf("%10.10lld %s.%d\t", (long long)kp->ktr_timestamp, + db_printf(" %10.10lld %s.%d", (long long)kp->ktr_timestamp, kp->ktr_file, kp->ktr_line); } + db_printf(": "); db_printf(kp->ktr_desc, kp->ktr_parms[0], kp->ktr_parms[1], kp->ktr_parms[2], kp->ktr_parms[3], kp->ktr_parms[4], kp->ktr_parms[5]); diff --git a/sys/sys/ktr.h b/sys/sys/ktr.h index 224ee2c..62b32f3 100644 --- a/sys/sys/ktr.h +++ b/sys/sys/ktr.h @@ -109,6 +109,7 @@ struct ktr_entry { int ktr_line; const char *ktr_file; const char *ktr_desc; + struct thread *ktr_thread; u_long ktr_parms[KTR_PARMS]; }; -- cgit v1.1