Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2000 15:31:29 -0600
From:      Dan Nelson <dnelson@emsphone.com>
To:        John Baldwin <jhb@FreeBSD.ORG>
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>
In-Reply-To: <XFMail.001128124312.jhb@FreeBSD.org>; from "John Baldwin" on Tue Nov 28 12:43:12 GMT 2000
References:  <XFMail.001128124312.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001128153129.A1447>