From koenig@ceres.tat.physik.uni-tuebingen.de Tue Oct 29 22:10:12 1996
Received: from iwr1.iwr.uni-heidelberg.de (iwr1.ARPA) by kalliope.iwr.uni-heidelberg.de (4.1/ZRZ)
	  id AA05467; Tue, 29 Oct 96 22:10:07 +0100
Received: from noc.belwue.de (root@noc.BelWue.DE [129.143.2.1]) by iwr1.iwr.uni-heidelberg.de (8.7.6/8.7.6) with ESMTP id WAA27583 for <Helmut.Geyer@iwr.uni-heidelberg.de>; Tue, 29 Oct 1996 22:10:05 +0100 (MET)
Received: from ceres.tat.physik.uni-tuebingen.de (ceres.tat.physik.uni-tuebingen.de [134.2.170.12]) by noc.belwue.de with SMTP id OAA22795
  (8.6.13/IDA-1.6); Tue, 29 Oct 1996 14:49:19 +0100
Received: by ceres.tat.physik.uni-tuebingen.de (951211.SGI.8.6.12.PATCH1042/951211.SGI)
	 id OAA25884; Tue, 29 Oct 1996 14:47:39 +0100
Received: by ceres.tat.physik.uni-tuebingen.de (Smail3.1.28.1 #20)
	id m0vIDs0-0001jhC; Tue, 29 Oct 96 14:06 MET
Message-Id: <m0vIDs0-0001jhC@ceres.tat.physik.uni-tuebingen.de>
From: koenig@tat.physik.uni-tuebingen.de (Harald Koenig)
Subject: Re: procps auf Alphas
To: Helmut.Geyer@iwr.uni-heidelberg.de (Helmut Geyer)
Date: Tue, 29 Oct 1996 14:06:16 +0100 (MET)
Cc: koenig@tat.physik.uni-tuebingen.de, cblake@bbn.com
In-Reply-To: <9610231955.AA02526@thalia.iwr.uni-heidelberg.de> from "Helmut Geyer" at Oct 23, 96 09:55:10 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Status: RO

> I left the units in the new format, as more people complained about the
> version where these were missing. As many people want the old format, I 
> included the old format for time intervals, the default behaviour beeing
> selectable at compile time and switchable by command line option and
> interactive commands for ps, w and top. By standard the old format is
> selected for now.

thanks

> Is this new in 2.1.* ? Before <asm/byteorder.h> was included from <linux/in.h>
> even when __KERNEL__ wasn't defined.

there is an "inofficial" kernel patch for AXP which includes
things which Linus hasn't yet merged into main stream kernel
on  ftp://ftp.azstarnet.com/pub/linux/axp/sys/axp-diffs-2.[01].*.gz
this always included the following fragment:

-------------------------------------------------------------------------------
diff -urN 386/include/linux/in.h linux/include/linux/in.h
--- 386/include/linux/in.h      Tue Aug 20 18:06:49 1996
+++ linux/include/linux/in.h    Sat Sep  7 22:31:11 1996
@@ -115,12 +115,12 @@
 #define INADDR_ALLHOSTS_GROUP  0xe0000001      /* 224.0.0.1   */
 #define INADDR_MAX_LOCAL_GROUP  0xe00000ff      /* 224.0.0.255 */
 
+/* Some random defines to make it easier in the kernel.. */
+#ifdef __KERNEL__
+
 /* <asm/byteorder.h> contains the htonl type stuff.. */
 
 #include <asm/byteorder.h> 
-
-/* Some random defines to make it easier in the kernel.. */
-#ifdef __KERNEL__
 
 #define LOOPBACK(x)    (((x) & htonl(0xff000000)) == htonl(0x7f000000))
 #define MULTICAST(x)   (((x) & htonl(0xf0000000)) == htonl(0xe0000000))
-------------------------------------------------------------------------------


below is one more small fix because the "n" option was broken.
try "ps l" and "ps ln" which doesn't display numeric WCHAN addresses.

also numeric addresses would be 16 hex characters but since they're
all prefixed with "fffffc0" it's no big problem to display "only"
the lower 32 bit in showtask.c.


one more commment about your handling of overflowed fields which 
was shown by trying to display 64bit WCHAN addresses which are all
displayed as ">>>>>>>>":

as I alrealy mentioned in my last mail I don't like this method of
"truncation" at all (same for "*****" fields in FORTRAN formatted output).
if there is an overflow I'd *really* like to sacrifice the wonderful table
format but still get the information I'm looking for.  only showing
">>>>>>>>>" to sign that it won't fit into this wonderful nice table
isn't very useful for users...

maybe that's subject to another option "--force-wonderful-tables" ?!


Harald
-------------------------------------------------------------------------------
diff -ur .old/procps-1.10.1/proc/showtask.c ./proc/showtask.c
--- .old/procps-1.10.1/proc/showtask.c	Wed Oct 23 20:42:16 1996
+++ ./proc/showtask.c	Thu Oct 24 00:37:17 1996
@@ -937,7 +937,7 @@
  	    if (TEST(WCHAN))
 		n = print_str (wchan (task->wchan), max);
 	    else
-		n = print_hex (task->wchan, max);
+		n = print_hex (task->wchan & 0xffffffff, max);
 	    break;
         case P_SIGNAL:
             n = print_hex (task->signal, max);
diff -ur .old/procps-1.10.1/ps.c ./ps.c
--- .old/procps-1.10.1/ps.c	Wed Oct 23 21:45:30 1996
+++ ./ps.c	Thu Oct 24 00:38:11 1996
@@ -140,7 +140,7 @@
 int      GL_current_time; /* some global system parameters */
 unsigned GL_main_mem;
 long     GL_time_now;
-int      GL_wchan_nout;   /* this is can also be set on the command-line  */
+int      GL_wchan_nout = 0;   /* this is can also be set on the command-line  */
 
 int      GL_width = 0,
          GL_pflags = 0,
@@ -672,11 +672,12 @@
             CL_pcpu = 1;
             break;
         } else if (disp_options.p[i] == P_WCHAN) {
-            if (open_psdb())
+            if (GL_wchan_nout || open_psdb())
                 GL_wchan_nout = 1;
-            else
+            else {
                 disp_options.flags |= DISP_WCHAN;
                 psdbsucc = 1;
+	    }
             break;
         }
     
--
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^




