Date: Mon, 14 Aug 2006 18:25:34 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 103884 for review Message-ID: <200608141825.k7EIPYVb015918@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=103884 Change 103884 by jhb@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608141825.k7EIPYVb015918>