From owner-cvs-src@FreeBSD.ORG Fri Jun 6 23:00:58 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66AD537B401; Fri, 6 Jun 2003 23:00:58 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6834C43FA3; Fri, 6 Jun 2003 23:00:56 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h5760p8W061077; Fri, 6 Jun 2003 23:00:52 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h5760ojF061076; Fri, 6 Jun 2003 23:00:50 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Fri, 6 Jun 2003 23:00:50 -0700 From: David Schultz To: Greg Lehey Message-ID: <20030607060050.GB60955@HAL9000.homeunix.com> Mail-Followup-To: Greg Lehey , src-committers@freebsd.org, cvs-src@freebsd.org, cvs-all@freebsd.org References: <200306060642.h566g2Hn097640@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200306060642.h566g2Hn097640@repoman.freebsd.org> cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/debugscripts gdbinit.i386 gdbinit.kernel gdbinit.vinum X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2003 06:00:58 -0000 On Thu, Jun 05, 2003, Greg Lehey wrote: > grog 2003/06/05 23:42:01 PDT > > FreeBSD src repository > > Added files: > sys/debugscripts gdbinit.i386 gdbinit.kernel gdbinit.vinum > Log: > Add macros for kernel debugging. These have been around for a > while, and they will need some more tuning before they're really > useful, but at the moment they're better than nothing. Cool, these look useful. I just started writing some macros for poking around mounts and vnodes the other day, although I haven't yet come up with a particularly good way of printing vnodes. If someone has something better, I'd love to see it. define _getmnt set $_mp = mountlist->tqh_first set $_i = $arg0 while $_i != 0 && $_mp != 0 set $_mp = $_mp->mnt_list->tqe_next set $_i -= 1 end if $_mp == 0 printf "Error: end of mount list\n" end end define _vnprint print $arg0 end define mntstat _getmnt $arg0 printf "%s filesystem %s mounted on %s\n", \ $_mp->mnt_stat->f_fstypename, \ $_mp->mnt_stat->f_mntonname, \ $_mp->mnt_stat->f_mntfromname printf "frag size: %12ld\tblock size: %11ld\n", \ $_mp->mnt_stat->f_bsize, $_mp->mnt_stat->f_iosize printf "blocks: %15ld\tblocks free: %10ld\n", \ $_mp->mnt_stat->f_blocks, $_mp->mnt_stat->f_bfree printf "inodes: %15ld\tinodes free: %10ld\n", \ $_mp->mnt_stat->f_files, $_mp->mnt_stat->f_ffree printf "flags: 0x%08x\towner: %16d\n", \ $_mp->mnt_stat->f_flags, $_mp->mnt_stat->f_owner printf "sync writes: %10d\tasync writes:%10d\n", \ $_mp->mnt_stat->f_syncwrites, $_mp->mnt_stat->f_asyncwrites printf "sync reads: %10d\tasync reads: %10d\n", \ $_mp->mnt_stat->f_syncreads, $_mp->mnt_stat->f_asyncreads end document mntstat Usage: mntstat index Print information about the indexth filesystem on the mount list. end define vnodes _getmnt $arg0 set $_vn = $_mp->mnt_nvnodelist.tqh_first set $_i = 0 printf "Counting vnodes; this could take a few minutes...\n" while $_vn != 0 set $_i += 1 set $_vn = $_vn->v_nmntvnodes.tqe_next end printf "\n%i vnodes:\n_________________________________\n", $_i set $_vn = $_mp->mnt_nvnodelist.tqh_first while $_vn != 0 _vnprint $_vn set $_vn = $_vn->v_nmntvnodes.tqe_next end end document vnodes Usage: vnodes index Print information about vnodes belonging to the indexth filesystem. end