- 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.
This commit is contained in:
Jeff Roberson 2005-06-10 23:21:29 +00:00
parent a3d97e12a0
commit 37ee2d8dd4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147278
2 changed files with 7 additions and 3 deletions

View File

@ -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]);

View File

@ -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];
};