From owner-svn-src-head@freebsd.org Sun Aug 14 15:26:41 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 A6FF7BBAB9D; Sun, 14 Aug 2016 15:26:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 650C317FC; Sun, 14 Aug 2016 15:26:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EFQegI064978; Sun, 14 Aug 2016 15:26:40 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EFQeUe064977; Sun, 14 Aug 2016 15:26:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141526.u7EFQeUe064977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 15:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304080 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Sun, 14 Aug 2016 15:26:41 -0000 Author: bde Date: Sun Aug 14 15:26:40 2016 New Revision: 304080 URL: https://svnweb.freebsd.org/changeset/base/304080 Log: In ddb ps, left justify the non-numeric fields 'state' and 'wmesg' and the fixed-width numeric field 'wchan', as in ps(1). They were sort of centered, although the template shows 'state' as right-justified. The `wmesg' field very rarely has a prefix of '*' (for lock names) that is still to the left of the header, and the width of this field is reduced from 8 to 7 (more than 6 is an error). The 'wmesg' and 'wchan' fields are still misnamed and poorly handled. They are named sort of backwards relative to ps(1): - wmesg in ddb = mwchan in ps - wmesg in ddb = wchan in ps (if it is a wait channel name, not a lock name) - wchan in ddb = nwchan in ps ddb ps wastes lots of space for the unimportant 'wchan' field (20 columns altogether on 64-bit arches). ps(1) documents using a compressed format, but the compression only omits leading nybbles of 0 so it has neveqr worked on arches that put the kernel in the top half of the address space. It just avoids wasting space for an 0x prefix. Modified: head/sys/ddb/db_ps.c Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Sun Aug 14 14:50:32 2016 (r304079) +++ head/sys/ddb/db_ps.c Sun Aug 14 15:26:40 2016 (r304080) @@ -69,10 +69,10 @@ DB_SHOW_ALL_COMMAND(procs, db_procs_cmd) * * 1 2 3 4 5 6 7 * 1234567890123456789012345678901234567890123456789012345678901234567890 - * pid ppid pgrp uid state wmesg wchan cmd - * < wmesg > < wchan > + * pid ppid pgrp uid state wmesg wchan cmd + * * (threaded) - * < wmesg > < wchan > + * * * For machines with 64-bit pointers, we expand the wchan field 8 more * characters. @@ -95,9 +95,9 @@ db_ps(db_expr_t addr, bool hasaddr, db_e p = &proc0; #ifdef __LP64__ - db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); + db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); #else - db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); + db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); #endif while (--np >= 0 && !db_pager_quit) { if (p == NULL) { @@ -279,15 +279,15 @@ dumpthread(volatile struct proc *p, vola wmesg = ""; wchan = NULL; } - db_printf("%c%-8.8s ", wprefix, wmesg); + db_printf("%c%-7.7s ", wprefix, wmesg); if (wchan == NULL) #ifdef __LP64__ - db_printf("%18s ", ""); + db_printf("%18s ", ""); #else - db_printf("%10s ", ""); + db_printf("%10s ", ""); #endif else - db_printf("%p ", wchan); + db_printf("%p ", wchan); if (p->p_flag & P_SYSTEM) db_printf("["); if (td->td_name[0] != '\0')