From owner-svn-src-head@freebsd.org Fri Jun 10 03:08:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABBF3B71051; Fri, 10 Jun 2016 03:08:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B60631070; Fri, 10 Jun 2016 03:08:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5A38Xuv034353 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 10 Jun 2016 06:08:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5A38Xuv034353 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5A38WUM034352; Fri, 10 Jun 2016 06:08:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 10 Jun 2016 06:08:32 +0300 From: Konstantin Belousov To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301751 - head/sys/kern Message-ID: <20160610030832.GC38613@kib.kiev.ua> References: <201606091827.u59IRfD1090422@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606091827.u59IRfD1090422@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 03:08:44 -0000 On Thu, Jun 09, 2016 at 06:27:41PM +0000, Conrad E. Meyer wrote: > Author: cem > Date: Thu Jun 9 18:27:41 2016 > New Revision: 301751 > URL: https://svnweb.freebsd.org/changeset/base/301751 > > Log: > Add DDB command "kldstat" > > It prints much the same information as kldstat(8) without any arguments. > > Suggested by: jhibbits > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/kern/kern_linker.c > > Modified: head/sys/kern/kern_linker.c > ============================================================================== > --- head/sys/kern/kern_linker.c Thu Jun 9 18:24:51 2016 (r301750) > +++ head/sys/kern/kern_linker.c Thu Jun 9 18:27:41 2016 (r301751) > @@ -54,6 +54,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifdef DDB > +#include > +#endif > + > #include > > #include > @@ -1256,6 +1260,23 @@ kern_kldstat(struct thread *td, int file > return (0); > } > > +#ifdef DDB > +DB_COMMAND(kldstat, db_kldstat) This would arguably more visible if done as the 'show klds' or similar subcommand. The first place where people accustomed to ddb look when want to see some kernel structures dumped, is 'show'. BTW, a useful tradition is to have 'show kld ' and 'show klds' commands. If not clear from the structure, the first command would print the information about single linker file at the given address (whatever it is), and second does what your current 'kldstat' offer. > +{ > + linker_file_t lf; > + > +#define POINTER_WIDTH ((int)(sizeof(void *) * 2 + 2)) > + db_printf("Id Refs Address%*c Size Name\n", POINTER_WIDTH - 7, ' '); > +#undef POINTER_WIDTH > + TAILQ_FOREACH(lf, &linker_files, link) { > + if (db_pager_quit) > + return; > + db_printf("%2d %4d %p %-8zx %s\n", lf->id, lf->refs, > + lf->address, lf->size, lf->filename); > + } > +} > +#endif /* DDB */ > + > int > sys_kldfirstmod(struct thread *td, struct kldfirstmod_args *uap) > {