From owner-cvs-all@FreeBSD.ORG Sun Jul 3 00:59:18 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6DD316A7B1; Sun, 3 Jul 2005 00:57:02 +0000 (GMT) (envelope-from ps@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD6AB44E5B; Sun, 3 Jul 2005 00:36:21 +0000 (GMT) (envelope-from ps@mu.org) Received: by elvis.mu.org (Postfix, from userid 1000) id 7149C67144; Sat, 2 Jul 2005 17:36:08 -0700 (PDT) X-Original-To: ps@mu.org Delivered-To: ps@mu.org Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by elvis.mu.org (Postfix) with ESMTP id 29D485C9BC for ; Tue, 28 Dec 2004 13:57:24 -0800 (PST) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 025AD56A2C for ; Tue, 28 Dec 2004 21:57:24 +0000 (GMT) (envelope-from owner-src-committers@FreeBSD.org) Received: by hub.freebsd.org (Postfix) id A8C8016A54F; Tue, 28 Dec 2004 21:57:14 +0000 (GMT) Delivered-To: ps@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 538) id ABA2416A4D0; Tue, 28 Dec 2004 21:57:12 +0000 (GMT) Delivered-To: src-committers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 003CD16A4CE; Tue, 28 Dec 2004 21:57:10 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5ADFD43D1F; Tue, 28 Dec 2004 21:57:10 +0000 (GMT) (envelope-from arr@watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id iBSLrneV036927; Tue, 28 Dec 2004 16:53:49 -0500 (EST) (envelope-from arr@watson.org) Received: from localhost (arr@localhost) by fledge.watson.org (8.13.1/8.13.1/Submit) with ESMTP id iBSLrnVM036924; Tue, 28 Dec 2004 16:53:49 -0500 (EST) (envelope-from arr@watson.org) X-Authentication-Warning: fledge.watson.org: arr owned process doing -bs From: "Andrew R. Reiter" To: John Baldwin In-Reply-To: <200412281048.42213.jhb@FreeBSD.org> Message-ID: <20041228165334.G36918@fledge.watson.org> References: <200412262252.iBQMqPe7060613@repoman.freebsd.org> <200412271600.26989.jhb@FreeBSD.org> <20041227172424.A85914@fledge.watson.org> <200412281048.42213.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-src-committers@FreeBSD.org Precedence: bulk X-Loop: FreeBSD.ORG X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on elvis.mu.org X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Level: Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, rwatson@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern subr_witness.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 03 Jul 2005 00:59:20 -0000 X-Original-Date: Tue, 28 Dec 2004 16:53:49 -0500 (EST) X-List-Received-Date: Sun, 03 Jul 2005 00:59:20 -0000 On Tue, 28 Dec 2004, John Baldwin wrote: :On Monday 27 December 2004 05:27 pm, Andrew R. Reiter wrote: :> On Mon, 27 Dec 2004, John Baldwin wrote: :> :On Sunday 26 December 2004 07:54 pm, Kris Kennaway wrote: :> :> On Sun, Dec 26, 2004 at 10:52:24PM +0000, Robert Watson wrote: :> :> > rwatson 2004-12-26 22:52:24 UTC :> :> > :> :> > FreeBSD src repository :> :> > :> :> > Modified files: :> :> > sys/kern subr_witness.c :> :> > Log: :> :> > Add "show alllocks" command to DDB, which dumps a list of processes :> :> > and threads currently holding sleep mutexes (and spin mutexes for :> :> > curthread). This can be quite useful in looking for a lock :> :> > condition summary for a system, as it avoids manually iterating :> :> > through threads and processes to find all the interesting locks. :> :> > :> :> > NB: "alllocks" is up there with "lockedvnods" for a bad argument for :> :> > show. :> :> :> :> ITYM "allloks" or perhaps "alllockes" (conservation of vowels). :> : :> :If you want a better name you could do 'show locks /a' instead. That is, :> : add support to 'show locks' for the /a option (see 'show ktr' for how you :> : would handle this by looking at 'modif'). :> :> Seems like a good idea to me, John. My only -- very minor -- issue with :> that is using '/' as the flag delimiter. Not trying to be an asshole or :> anything, just seems to me that (unless there is some ddb options already :> there that use '/') using the forward slash is very cmd.exe-esque. :> :> I agree, however, that having show locks is a good idea :> instead of two different commands. : :The / is part of ddb itself. Each ddb command (except those that do their own :command line parsing) is called with a variable containing the arguments and :another variable (modif) containing a string of any options specified via /. :For example: : :DB_SHOW_COMMAND(ktr, db_ktr_all) :{ : int quit; : : quit = 0; : tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1); : tstate.first = -1; : if (strcmp(modif, "v") == 0) : db_ktr_verbose = 1; : else : db_ktr_verbose = 0; : if (strcmp(modif, "a") == 0) { : while (cncheckc() != -1) : if (db_mach_vtrace() == 0) : break; : } else { : db_setup_paging(db_simple_pager, &quit, db_lines_per_page); : while (!quit) : if (db_mach_vtrace() == 0) : break; : } :} : :This implements 'show ktr' and allows 'show ktr /a' and 'show ktr /v'. Note :that it doesn't handle 'show ktr /av' or 'show ktr /va'. :-) : Oh. :-) -- Andrew R. Reiter arr@watson.org arr@FreeBSD.org