From owner-p4-projects@FreeBSD.ORG Mon Aug 14 18:25:47 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7771216A4E8; Mon, 14 Aug 2006 18:25:47 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5250216A4E6 for ; Mon, 14 Aug 2006 18:25:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 519BC43D69 for ; Mon, 14 Aug 2006 18:25:34 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7EIPYhd015923 for ; Mon, 14 Aug 2006 18:25:34 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7EIPYVb015918 for perforce@freebsd.org; Mon, 14 Aug 2006 18:25:34 GMT (envelope-from jhb@freebsd.org) Date: Mon, 14 Aug 2006 18:25:34 GMT Message-Id: <200608141825.k7EIPYVb015918@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 103884 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 18:25:47 -0000 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