Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2002 16:16:26 -0800
From:      Peter Wemm <peter@wemm.org>
To:        Bernd Walter <ticso@cicely8.cicely.de>
Cc:        Steve Price <steve@havk.org>, alpha@FreeBSD.ORG
Subject:   Re: ps(1) output Q 
Message-ID:  <20020201001626.3AB243809@overcee.wemm.org>
In-Reply-To: <20020131103128.GA6082@cicely8.cicely.de> 

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

Bernd Walter wrote:
> On Wed, Jan 30, 2002 at 10:00:15PM -0600, Steve Price wrote:
> > Here's a really stupid question but something I've wondered for a long
> > time.  Why is it that the output of ps(1) on the Alpha always looks like
> > this?
> > 
> >   PID  TT  STAT      TIME COMMAND
> > 77337  p0  Ss     0:00.21  (csh)
> > 78179  p0  R+     0:00.00  (ps)
> 
> You can't access the remaining process informations, either by
> permission or if the process is swapped.
> 
> > While on the x86 it look like this?
> > 
> >   PID  TT  STAT      TIME COMMAND
> > 80796  p0  Is+    0:00.04 zsh
> > 14534  r5  I+     3:48.99 mutt -y
> 
> Put some mmeory load on the host or look at process from other users
> and you will see this too.

Care to double check this patch?
----------------------------
revision 1.41
date: 2001/11/08 00:23:06;  author: peter;  state: Exp;  lines: +3 -3
kern.ps_arg_max_cache is a long, not an int.  I believe this is half of
what broke ps on ia64.  It probably also broke on alpha, but the fallback
method of using lseek/read on /proc/*/mem to read ps_strings seems to
work there.  It doesn't on ia64 yet.
----------------------------
revision 1.25.2.2
date: 2002/01/31 23:47:10;  author: peter;  state: Exp;  lines: +1 -1
MFC 1.41: kern.ps_arg_max_cache is a long, not an int.  This breaks
ps(1) without /proc on 4.x on alpha.
----------------------------

RCS file: /home/ncvs/src/lib/libkvm/kvm_proc.c,v
retrieving revision 1.25.2.1
retrieving revision 1.25.2.2
diff -u -r1.25.2.1 -r1.25.2.2
--- kvm_proc.c  1 Jul 2000 05:39:52 -0000       1.25.2.1
+++ kvm_proc.c  31 Jan 2002 23:47:10 -0000      1.25.2.2
@@ -670,7 +670,7 @@
        int oid[4];
        int i;
        size_t bufsz;
-       static int buflen;
+       static unsigned long buflen;
        static char *buf, *p;
        static char **bufp;
        static int argc;

It seems to fix it for me, but a double check from somebody else would be
handy in case it depends on something else that I've forgotten about.

Dont forget to umount /proc while testing.

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message



home | help

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