PERFORCE change 103884 for review
John Baldwin
jhb at FreeBSD.org
Mon Aug 14 18:25:47 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=103884
Change 103884 by jhb at jhb_mutex on 2006/08/14 18:25:33
Just do it inline using db_printf() and showing more info about the
owning thread.
Affected files ...
.. //depot/projects/smpng/sys/kern/kern_lock.c#50 edit
Differences ...
==== //depot/projects/smpng/sys/kern/kern_lock.c#50 (text+ko) ====
@@ -619,13 +619,25 @@
DB_SHOW_COMMAND(lockmgr, db_show_lockmgr)
{
+ struct thread *td;
struct lock *lkp;
if (!have_addr)
return;
lkp = (struct lock *)addr;
- /* XXX: Should use db_printf(). */
- lockmgr_printinfo(lkp);
+ db_printf("lock type: %s\n", lkp->lk_wmesg);
+ db_printf("state: ");
+ if (lkp->lk_sharecount)
+ db_printf("SHARED (count %d)\n", lkp->lk_sharecount);
+ else if (lkp->lk_flags & LK_HAVE_EXCL) {
+ td = lkp->lk_lockholder;
+ db_printf("EXCL (count %d) %p ", lkp->lk_exclusivecount, td);
+ db_printf("(tid %d, pid %d, \"%s\")\n", td->td_tid,
+ td->td_proc->p_pid, td->td_proc->p_comm);
+ } else
+ db_printf("UNLOCKED\n");
+ if (lkp->lk_waitcount > 0)
+ db_printf("waiters: %d\n", lkp->lk_waitcount);
}
#endif
More information about the p4-projects
mailing list