From owner-svn-src-head@FreeBSD.ORG Fri Dec 19 11:11:19 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8971106568D; Fri, 19 Dec 2008 11:11:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 744AF8FC20; Fri, 19 Dec 2008 11:11:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-157-49.carlnfd1.nsw.optusnet.com.au (c122-106-157-49.carlnfd1.nsw.optusnet.com.au [122.106.157.49]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id mBJBBFpD018206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Dec 2008 22:11:17 +1100 Date: Fri, 19 Dec 2008 22:11:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ivan Voras In-Reply-To: <200812181525.mBIFPXkN044933@svn.freebsd.org> Message-ID: <20081219211850.X99600@delplex.bde.org> References: <200812181525.mBIFPXkN044933@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r186285 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 19 Dec 2008 11:11:20 -0000 On Thu, 18 Dec 2008, Ivan Voras wrote: > Log: > Remove spaces in wait object names to make top (1) output prettier and > unbreak scripts that examine ps (1) output. Thanks, but these are still broken. Both ps and top use %6.6s format, so wait messages must be limited to 6 characters or at least contain only secondary info after the 6th character, with the first 6 characters carefully chosen to be unambigous and to be a good abbreviation when truncated too. I once fixed many sleep messages including all of the ones in the tty driver to satisfy the first (stricter) requirement. > Modified: head/sys/kern/tty.c > ============================================================================== > --- head/sys/kern/tty.c Thu Dec 18 15:12:04 2008 (r186284) > +++ head/sys/kern/tty.c Thu Dec 18 15:25:33 2008 (r186285) > @@ -871,10 +871,10 @@ tty_alloc(struct ttydevsw *tsw, void *sc > > tty_init_termios(tp); > > - cv_init(&tp->t_inwait, "tty input"); > - cv_init(&tp->t_outwait, "tty output"); > - cv_init(&tp->t_bgwait, "tty background"); > - cv_init(&tp->t_dcdwait, "tty dcd"); > + cv_init(&tp->t_inwait, "ttyinput"); When truncated, this has regressed from "ttyin" to "ttyinp". Not too bad. The kernel struct member name still uses the better abbreviation "in" for "input". > + cv_init(&tp->t_outwait, "ttyoutput"); This gets truncated reasonably. > + cv_init(&tp->t_bgwait, "ttybackground"); When truncated, this has regressed from "ttybg[1-4]" to "ttybac". The kernel struct member name still uses the better abbreviation "bg". "bg[1-4]" also encodes more detailed info about the reason for the wait. Most locking interfaces encourage this regression by putting the message in a data structure so that it is hard to make it context-dependent. > + cv_init(&tp->t_dcdwait, "ttydcd"); The commit fixes this. > > ttyinq_init(&tp->t_inq); > ttyoutq_init(&tp->t_outq); > @@ -884,7 +884,7 @@ tty_alloc(struct ttydevsw *tsw, void *sc > tp->t_mtx = mutex; > } else { > tp->t_mtx = &tp->t_mtxobj; > - mtx_init(&tp->t_mtxobj, "tty lock", NULL, MTX_DEF); > + mtx_init(&tp->t_mtxobj, "ttylock", NULL, MTX_DEF); This gets truncated to "ttyloc". "ttylk" or "ttlock" would be better. The abbreviation "mtx" in the kernel struct member name is not so good as elsewhere for printing in userland. > } > > knlist_init(&tp->t_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL); Bruce