From owner-freebsd-hackers Tue Nov 28 13:31:34 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 3B02937B402; Tue, 28 Nov 2000 13:31:31 -0800 (PST) Received: (from dan@localhost) by dan.emsphone.com (8.11.1/8.11.1) id eASLVTL13513; Tue, 28 Nov 2000 15:31:29 -0600 (CST) (envelope-from dan) Date: Tue, 28 Nov 2000 15:31:29 -0600 From: Dan Nelson To: John Baldwin Cc: hackers@FreeBSD.ORG Subject: Re: Fixes to top(1) to use the full width of the screen for p_comm Message-ID: <20001128153129.A1447@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline User-Agent: Mutt/1.3.12i In-Reply-To: ; from "John Baldwin" on Tue Nov 28 12:43:12 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In the last episode (Nov 28), John Baldwin said: > Hey gang, > > One of my favorite tools to use during the SMPng stuff is top(1) as I > get to see all the Happy Little Processes bouncing around on CPU's > and getting stuck in SMTX, etc. On a related note, here's a little patch to top that digs around and tells you what mutex a process is waiting on. It replaces "MUTEX" with "M######", where "######" is the first 6 characters of the mutex name passed to mtx_init. At the moment all I see is "MGiant" all over the place, but hopefully that'll change soon :) -- Dan Nelson dnelson@emsphone.com --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="top.diff" Index: machine.c =================================================================== RCS file: /home/ncvs/src/usr.bin/top/machine.c,v retrieving revision 1.30 diff -b -u -p -r1.30 machine.c --- machine.c 2000/09/07 01:32:38 1.30 +++ machine.c 2000/11/22 15:21:10 @@ -587,6 +587,19 @@ char *(*get_userid)(); else strcpy(status, "RUN"); break; + case SMTX: + if (PP(pp, p_blocked) != NULL) + { + struct mtx mt; + char descr[80]; + getkval(PP(pp,p_blocked), &mt, sizeof(mt), "!"); + getkval(mt.mtx_description, descr, 80, "!"); + sprintf(status, "M%.6s", descr); + } else + { + sprintf(status, "MUTEX"); + } + break; case SSLEEP: if (PP(pp, p_wmesg) != NULL) { sprintf(status, "%.6s", EP(pp, e_wmesg)); --bg08WKrSYDhXBjb5-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message