public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
@ 2002-07-24  5:59 Dylan Cuthbert
  2002-07-24  6:32 ` Gunnar Norling
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Dylan Cuthbert @ 2002-07-24  5:59 UTC (permalink / raw)
  To: cygwin

Hi there,

I've searched through the archives but can't seem to find any mention of
this, is there a way to display the cpu load via a shell utility?

If not, can someone point me to the posix function call (if it exists) so I
can write a little utility.  I want to do some load balanced compiles across
several machines by spawning the compile across the network via "make -j",
and a wrapper for gcc, then use rsh (ssh or rexec) and network sharing to do
the compile.  The thing is I only want to use machines whose loads are low.

Of course, if a tool for this kind of thing already exists, then please give
me a pointer.

Regards

---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-24  5:59 a way to read the current cpu load from the shell or via a cmdline utility in cygwin? Dylan Cuthbert
@ 2002-07-24  6:32 ` Gunnar Norling
  2002-07-24  6:45 ` John Morrison
  2002-07-26 13:48 ` Chris January
  2 siblings, 0 replies; 31+ messages in thread
From: Gunnar Norling @ 2002-07-24  6:32 UTC (permalink / raw)
  To: 'Dylan Cuthbert', cygwin

Have you checked www.sysinternals.com? They might have something.
/norling

> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com]On Behalf Of Dylan Cuthbert
> Sent: den 24 juli 2002 09:32
> To: cygwin@cygwin.com
> Subject: a way to read the current cpu load from the shell or 
> via a cmdline utility in cygwin?
> 
> 
> Hi there,
> 
> I've searched through the archives but can't seem to find any 
> mention of
> this, is there a way to display the cpu load via a shell utility?
> 
> If not, can someone point me to the posix function call (if 
> it exists) so I
> can write a little utility.  I want to do some load balanced 
> compiles across
> several machines by spawning the compile across the network 
> via "make -j",
> and a wrapper for gcc, then use rsh (ssh or rexec) and 
> network sharing to do
> the compile.  The thing is I only want to use machines whose 
> loads are low.
> 
> Of course, if a tool for this kind of thing already exists, 
> then please give
> me a pointer.
> 
> Regards
> 
> ---------------------------------
> Q-Games, Dylan Cuthbert.
> http://www.q-games.com
> 
> 
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-24  5:59 a way to read the current cpu load from the shell or via a cmdline utility in cygwin? Dylan Cuthbert
  2002-07-24  6:32 ` Gunnar Norling
@ 2002-07-24  6:45 ` John Morrison
  2002-07-25  1:57   ` Jim George
  2002-07-26 13:48 ` Chris January
  2 siblings, 1 reply; 31+ messages in thread
From: John Morrison @ 2002-07-24  6:45 UTC (permalink / raw)
  To: cygwin

Does cat /proc/stat | grep cpu give you the information you want?

J.

On Wed, 24 Jul 2002, Dylan Cuthbert wrote:
> Hi there,
>
> I've searched through the archives but can't seem to find any mention of
> this, is there a way to display the cpu load via a shell utility?
>
> If not, can someone point me to the posix function call (if it exists) so I
> can write a little utility.  I want to do some load balanced compiles across
> several machines by spawning the compile across the network via "make -j",
> and a wrapper for gcc, then use rsh (ssh or rexec) and network sharing to do
> the compile.  The thing is I only want to use machines whose loads are low.
>
> Of course, if a tool for this kind of thing already exists, then please give
> me a pointer.
>
> Regards
>
> ---------------------------------
> Q-Games, Dylan Cuthbert.
> http://www.q-games.com


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-24  6:45 ` John Morrison
@ 2002-07-25  1:57   ` Jim George
  2002-07-25  6:01     ` Igor Pechtchanski
  0 siblings, 1 reply; 31+ messages in thread
From: Jim George @ 2002-07-25  1:57 UTC (permalink / raw)
  To: John Morrison; +Cc: cygwin

On Wed, 24 Jul 2002 08:41:05 +0100 (BST)
John Morrison <john.r.morrison@ntlworld.com> wrote:

> Does cat /proc/stat | grep cpu give you the information you want?
> 
> J.
> 
> On Wed, 24 Jul 2002, Dylan Cuthbert wrote:
> > Hi there,
> >
> > I've searched through the archives but can't seem to find any mention of
> > this, is there a way to display the cpu load via a shell utility?
> >
> > If not, can someone point me to the posix function call (if it exists) so I
> > can write a little utility.  I want to do some load balanced compiles across
> > several machines by spawning the compile across the network via "make -j",
> > and a wrapper for gcc, then use rsh (ssh or rexec) and network sharing to do
> > the compile.  The thing is I only want to use machines whose loads are low.
> >
> > Of course, if a tool for this kind of thing already exists, then please give
> > me a pointer.
> >
> > Regards
> >
> > ---------------------------------
> > Q-Games, Dylan Cuthbert.
> > http://www.q-games.com
Under Linux we had 'top'.  Is there an equivalent or something that someone is working on?

Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-25  1:57   ` Jim George
@ 2002-07-25  6:01     ` Igor Pechtchanski
  2002-07-25  8:54       ` Tony Arnold
  2002-07-25  8:55       ` Greg McCrory
  0 siblings, 2 replies; 31+ messages in thread
From: Igor Pechtchanski @ 2002-07-25  6:01 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2097 bytes --]

On Wed, 24 Jul 2002, Jim George wrote:

> On Wed, 24 Jul 2002 08:41:05 +0100 (BST)
> John Morrison <john.r.morrison@ntlworld.com> wrote:
>
> > Does cat /proc/stat | grep cpu give you the information you want?
> >
> > J.
> >
> > On Wed, 24 Jul 2002, Dylan Cuthbert wrote:
> > > Hi there,
> > >
> > > I've searched through the archives but can't seem to find any mention of
> > > this, is there a way to display the cpu load via a shell utility?
> > >
> > > If not, can someone point me to the posix function call (if it exists) so I
> > > can write a little utility.  I want to do some load balanced compiles across
> > > several machines by spawning the compile across the network via "make -j",
> > > and a wrapper for gcc, then use rsh (ssh or rexec) and network sharing to do
> > > the compile.  The thing is I only want to use machines whose loads are low.
> > >
> > > Of course, if a tool for this kind of thing already exists, then please give
> > > me a pointer.
> > >
> > > Regards
> > >
> > > ---------------------------------
> > > Q-Games, Dylan Cuthbert.
> > > http://www.q-games.com
> Under Linux we had 'top'.  Is there an equivalent or something that
> someone is working on?
> Jim

Jim,

I did a google search on "linux top cpu load".  Here's a top from the
first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
It took about an hour to make it compile and run under cygwin 1.3.12-2 on
Win2k.  The patch is attached.

Note: I just compiled and ran the code; I haven't verified the correctness
of the output.  It seemed to work without crashing, and the output looked
plausible.  I also haven't tested it on any system other than mine (above).
Try it at your own risk.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file

[-- Attachment #2: Type: TEXT/PLAIN, Size: 10474 bytes --]

diff -N -c -r -x .defaults ../top-3.5beta9/Configure ./Configure
*** ../top-3.5beta9/Configure	Fri Dec 18 10:42:29 1998
--- ./Configure	Wed Jul 24 22:36:44 2002
***************
*** 503,509 ****
      -e "s|%topn%|$topn|" \
      -e "s|%delay%|$delay|" \
      -e "s|%random%|$random|" \
! 	top.local.H >top.local.h
  
  echo "Building top.1..."
  sed -e "s|%topn%|$topn|" \
--- 503,509 ----
      -e "s|%topn%|$topn|" \
      -e "s|%delay%|$delay|" \
      -e "s|%random%|$random|" \
! 	top.local.h.X >top.local.h
  
  echo "Building top.1..."
  sed -e "s|%topn%|$topn|" \
diff -N -c -r -x .defaults ../top-3.5beta9/Makefile.X ./Makefile.X
*** ../top-3.5beta9/Makefile.X	Tue Nov 19 21:19:24 1996
--- ./Makefile.X	Wed Jul 24 22:37:21 2002
***************
*** 63,69 ****
  	@echo 'You need to run the script "Configure" before running "make".'
  	exit 10
  
! top.local.h: top.local.H
  	@echo 'You need to run the script "Configure" before running "make".'
  	exit 10
  
--- 63,69 ----
  	@echo 'You need to run the script "Configure" before running "make".'
  	exit 10
  
! top.local.h: top.local.h.X
  	@echo 'You need to run the script "Configure" before running "make".'
  	exit 10
  
diff -N -c -r -x .defaults ../top-3.5beta9/commands.c ./commands.c
*** ../top-3.5beta9/commands.c	Wed Jul  1 15:30:08 1998
--- ./commands.c	Wed Jul 24 22:49:36 2002
***************
*** 446,451 ****
--- 446,452 ----
  char *str;
  
  {
+ #if defined(PRIO_PROCESS)
      register char negate;
      int prio;
      int procnum;
***************
*** 502,507 ****
--- 503,509 ----
  	    ERROR(str, errno);
  	}
      } while ((str = next_field(str)) != NULL);
+ #endif
  
      /* return appropriate error string */
      return(err_string());
diff -N -c -r -x .defaults ../top-3.5beta9/machine/m_linux.c ./machine/m_linux.c
*** ../top-3.5beta9/machine/m_linux.c	Wed Jul  1 15:32:49 1998
--- ./machine/m_linux.c	Wed Jul 24 23:15:42 2002
***************
*** 34,47 ****
--- 34,61 ----
  #include <sys/vfs.h>
  
  #include <sys/param.h>		/* for HZ */
+ 
+ #if 0
  #include <asm/page.h>		/* for PAGE_SHIFT */
+ #else
+ #define PAGE_SHIFT 12
+ #endif
+ 
+ #if 0
  #include <linux/tasks.h>	/* for NR_TASKS */
+ #else
+ #define NR_TASKS 1<<12
+ #endif
  
  #if 0
  #include <linux/proc_fs.h>	/* for PROC_SUPER_MAGIC */
  #else
+ #ifdef __CYGWIN__
+ #define PROC_SUPER_MAGIC 0x700ff
+ #else
  #define PROC_SUPER_MAGIC 0x9fa0
  #endif
+ #endif
  
  #define PROCFS "/proc"
  extern char *myname;
***************
*** 156,161 ****
--- 170,176 ----
  	{
  	    fprintf(stderr, "%s: proc filesystem not mounted on " PROCFS "\n",
  		    myname);
+ 	    fprintf(stderr, "    type=%x\n", sb.f_type);
  	    return -1;
  	}
      }
diff -N -c -r -x .defaults ../top-3.5beta9/top.c ./top.c
*** ../top-3.5beta9/top.c	Wed Jul  1 15:41:03 1998
--- ./top.c	Wed Jul 24 23:11:00 2002
***************
*** 143,149 ****
--- 143,153 ----
  
      static char tempbuf1[50];
      static char tempbuf2[50];
+ #if 0
      int old_sigmask;		/* only used for BSD-style signals */
+ #else
+     sigset_t sigmask, old_sigmask;
+ #endif
      int topn = Default_TOPN;
      int delay = Default_DELAY;
      int displays = 0;		/* indicates unspecified */
***************
*** 489,495 ****
--- 493,507 ----
      sighold(SIGQUIT);
      sighold(SIGTSTP);
  #else
+ #if 0
      old_sigmask = sigblock(Smask(SIGINT) | Smask(SIGQUIT) | Smask(SIGTSTP));
+ #else
+     (void) sigemptyset(&sigmask);
+     (void) sigaddset(&sigmask, SIGINT);
+     (void) sigaddset(&sigmask, SIGQUIT);
+     (void) sigaddset(&sigmask, SIGTSTP);
+     (void) sigprocmask(SIG_BLOCK, &sigmask, &old_sigmask);
+ #endif
  #endif
      init_screen();
      (void) signal(SIGINT, leave);
***************
*** 503,509 ****
--- 515,525 ----
      sigrelse(SIGQUIT);
      sigrelse(SIGTSTP);
  #else
+ #if 0
      (void) sigsetmask(old_sigmask);
+ #else
+     (void) sigprocmask(SIG_SETMASK, &old_sigmask, (sigset_t*)NULL);
+ #endif
  #endif
      if (warnings)
      {
***************
*** 940,945 ****
--- 956,963 ----
  int i;
  
  {
+     sigset_t sigmask;
+ 
      /* move to the lower left */
      end_screen();
      fflush(stdout);
***************
*** 951,957 ****
--- 969,981 ----
  #ifdef SIGRELSE
      sigrelse(SIGTSTP);
  #else
+ #if 0
      (void) sigsetmask(sigblock(0) & ~(1 << (SIGTSTP - 1)));
+ #else
+     (void) sigemptyset(&sigmask);
+     (void) sigaddset(&sigmask, SIGTSTP);
+     (void) sigprocmask(SIG_UNBLOCK, &sigmask, (sigset_t*)NULL);
+ #endif
  #endif
      (void) kill(0, SIGTSTP);
  
diff -N -c -r -x .defaults ../top-3.5beta9/top.local.H ./top.local.H
*** ../top-3.5beta9/top.local.H	Wed Apr 15 13:30:57 1992
--- ./top.local.H	Wed Dec 31 19:00:00 1969
***************
*** 1,68 ****
- /*
-  *  Top - a top users display for Berkeley Unix
-  *
-  *  Definitions for things that might vary between installations.
-  */
- 
- /*
-  *  The space command forces an immediate update.  Sometimes, on loaded
-  *  systems, this update will take a significant period of time (because all
-  *  the output is buffered).  So, if the short-term load average is above
-  *  "LoadMax", then top will put the cursor home immediately after the space
-  *  is pressed before the next update is attempted.  This serves as a visual
-  *  acknowledgement of the command.  On Suns, "LoadMax" will get multiplied by
-  *  "FSCALE" before being compared to avenrun[0].  Therefore, "LoadMax"
-  *  should always be specified as a floating point number.
-  */
- #ifndef LoadMax
- #define LoadMax  %LoadMax%
- #endif
- 
- /*
-  *  "Table_size" defines the size of the hash tables used to map uid to
-  *  username.  The number of users in /etc/passwd CANNOT be greater than
-  *  this number.  If the error message "table overflow: too many users"
-  *  is printed by top, then "Table_size" needs to be increased.  Things will
-  *  work best if the number is a prime number that is about twice the number
-  *  of lines in /etc/passwd.
-  */
- #ifndef Table_size
- #define Table_size	%TableSize%
- #endif
- 
- /*
-  *  "Nominal_TOPN" is used as the default TOPN when Default_TOPN is Infinity
-  *  and the output is a dumb terminal.  If we didn't do this, then
-  *  installations who use a default TOPN of Infinity will get every
-  *  process in the system when running top on a dumb terminal (or redirected
-  *  to a file).  Note that Nominal_TOPN is a default:  it can still be
-  *  overridden on the command line, even with the value "infinity".
-  */
- #ifndef Nominal_TOPN
- #define Nominal_TOPN	%NominalTopn%
- #endif
- 
- #ifndef Default_TOPN
- #define Default_TOPN	%topn%
- #endif
- 
- #ifndef Default_DELAY
- #define Default_DELAY	%delay%
- #endif
- 
- /*
-  *  If the local system's getpwnam interface uses random access to retrieve
-  *  a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining
-  *  RANDOM_PW will take advantage of that fact.  If RANDOM_PW is defined,
-  *  then getpwnam is used and the result is cached.  If not, then getpwent
-  *  is used to read and cache the password entries sequentially until the
-  *  desired one is found.
-  *
-  *  We initially set RANDOM_PW to something which is controllable by the
-  *  Configure script.  Then if its value is 0, we undef it.
-  */
- 
- #define RANDOM_PW	%random%
- #if RANDOM_PW == 0
- #undef RANDOM_PW
- #endif
--- 0 ----
diff -N -c -r -x .defaults ../top-3.5beta9/top.local.h.X ./top.local.h.X
*** ../top-3.5beta9/top.local.h.X	Wed Dec 31 19:00:00 1969
--- ./top.local.h.X	Wed Apr 15 13:30:57 1992
***************
*** 0 ****
--- 1,68 ----
+ /*
+  *  Top - a top users display for Berkeley Unix
+  *
+  *  Definitions for things that might vary between installations.
+  */
+ 
+ /*
+  *  The space command forces an immediate update.  Sometimes, on loaded
+  *  systems, this update will take a significant period of time (because all
+  *  the output is buffered).  So, if the short-term load average is above
+  *  "LoadMax", then top will put the cursor home immediately after the space
+  *  is pressed before the next update is attempted.  This serves as a visual
+  *  acknowledgement of the command.  On Suns, "LoadMax" will get multiplied by
+  *  "FSCALE" before being compared to avenrun[0].  Therefore, "LoadMax"
+  *  should always be specified as a floating point number.
+  */
+ #ifndef LoadMax
+ #define LoadMax  %LoadMax%
+ #endif
+ 
+ /*
+  *  "Table_size" defines the size of the hash tables used to map uid to
+  *  username.  The number of users in /etc/passwd CANNOT be greater than
+  *  this number.  If the error message "table overflow: too many users"
+  *  is printed by top, then "Table_size" needs to be increased.  Things will
+  *  work best if the number is a prime number that is about twice the number
+  *  of lines in /etc/passwd.
+  */
+ #ifndef Table_size
+ #define Table_size	%TableSize%
+ #endif
+ 
+ /*
+  *  "Nominal_TOPN" is used as the default TOPN when Default_TOPN is Infinity
+  *  and the output is a dumb terminal.  If we didn't do this, then
+  *  installations who use a default TOPN of Infinity will get every
+  *  process in the system when running top on a dumb terminal (or redirected
+  *  to a file).  Note that Nominal_TOPN is a default:  it can still be
+  *  overridden on the command line, even with the value "infinity".
+  */
+ #ifndef Nominal_TOPN
+ #define Nominal_TOPN	%NominalTopn%
+ #endif
+ 
+ #ifndef Default_TOPN
+ #define Default_TOPN	%topn%
+ #endif
+ 
+ #ifndef Default_DELAY
+ #define Default_DELAY	%delay%
+ #endif
+ 
+ /*
+  *  If the local system's getpwnam interface uses random access to retrieve
+  *  a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining
+  *  RANDOM_PW will take advantage of that fact.  If RANDOM_PW is defined,
+  *  then getpwnam is used and the result is cached.  If not, then getpwent
+  *  is used to read and cache the password entries sequentially until the
+  *  desired one is found.
+  *
+  *  We initially set RANDOM_PW to something which is controllable by the
+  *  Configure script.  Then if its value is 0, we undef it.
+  */
+ 
+ #define RANDOM_PW	%random%
+ #if RANDOM_PW == 0
+ #undef RANDOM_PW
+ #endif

[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-25  6:01     ` Igor Pechtchanski
@ 2002-07-25  8:54       ` Tony Arnold
  2002-07-25 10:01         ` Igor Pechtchanski
  2002-07-26 15:24         ` Chris January
  2002-07-25  8:55       ` Greg McCrory
  1 sibling, 2 replies; 31+ messages in thread
From: Tony Arnold @ 2002-07-25  8:54 UTC (permalink / raw)
  To: cygwin

Igor,

> I did a google search on "linux top cpu load".  Here's a top 
> from the first match: 
> http://www.groupsys.com/topsrc/top-> 3.5beta9.tar.gz
> It took 
> about an hour to make it compile and 
> run under cygwin 1.3.12-2 on Win2k.  The patch is attached.
> 
> Note: I just compiled and ran the code; I haven't verified 
> the correctness of the output.  It seemed to work without 
> crashing, and the output looked plausible.  I also haven't 
> tested it on any system other than mine (above). Try it at 
> your own risk.

Thanks for this, it's a good start to getting top working under Cygwin.

My question is that when you run the Configure script what do give as
the 'appropriate module' for the machine? I've used 'linux' but I wonder
if there is a better option, or whether we should invent a Cygwin
machine definition?

Secondly, when it runs, I'm not convinced the figures are correct! For
example, my setiathome process should show almost 100% cpu utilisation,
but it shows 0%! Is this a refelction of my choice above, or problems
with the /proc file system infotmation?

Hints and tips on this much appreciated.

Regards,
Tony.
-- 
Tony Arnold, Deputy to the Head of COS Division, Manchester Computing,
University of Manchester, Oxford Road, Manchester M13 9PL.
T: +44 (0)161 275 6093, F: +44 (0)870 136 1004, M: +44 (0)773 330 0039
E-mail: tony.arnold@man.ac.uk, Home: http://www.man.ac.uk/Tony.Arnold


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-25  6:01     ` Igor Pechtchanski
  2002-07-25  8:54       ` Tony Arnold
@ 2002-07-25  8:55       ` Greg McCrory
  2002-07-25 13:37         ` Igor Pechtchanski
  1 sibling, 1 reply; 31+ messages in thread
From: Greg McCrory @ 2002-07-25  8:55 UTC (permalink / raw)
  To: cygwin

At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
>On Wed, 24 Jul 2002, Jim George wrote:
>
>Jim,
>
>I did a google search on "linux top cpu load".  Here's a top from the
>first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
>It took about an hour to make it compile and run under cygwin 1.3.12-2 on
>Win2k.  The patch is attached.
>
>Note: I just compiled and ran the code; I haven't verified the correctness
>of the output.  It seemed to work without crashing, and the output looked
>plausible.  I also haven't tested it on any system other than mine (above).
>Try it at your own risk.
>     Igor


Notes on my quick attempt this morning:

To get the ./Configure to run properly I needed a symbolic link to tcsh:
ln -s /bin/tcsh /bin/csh

Also chose module linux when asked.

for owner, used SYSTEM instead of default root

install script did not move the executable into the proper directory:

./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
chown: changing ownership of `/usr/local/bin/top': No such file or directory
chgrp: changing group of `/usr/local/bin/top': No such file or directory
chmod: changing permissions of `/usr/local/bin/top': No such file or directory
make: *** [install-top] Error 1

I was able to install it manually and it appears to work.

GMc


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: a way to read the current cpu load from the shell or via a cmdline utility in cygwin?
  2002-07-25  8:54       ` Tony Arnold
@ 2002-07-25 10:01         ` Igor Pechtchanski
  2002-07-26 15:24         ` Chris January
  1 sibling, 0 replies; 31+ messages in thread
From: Igor Pechtchanski @ 2002-07-25 10:01 UTC (permalink / raw)
  To: cygwin

Tony,

On Thu, 25 Jul 2002, Tony Arnold wrote:

> > I did a google search on "linux top cpu load".  Here's a top
> > from the first match:
> > http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> > It took about an hour to make it compile and
> > run under cygwin 1.3.12-2 on Win2k.  The patch is attached.
> >
> > Note: I just compiled and ran the code; I haven't verified
> > the correctness of the output.  It seemed to work without
> > crashing, and the output looked plausible.  I also haven't
> > tested it on any system other than mine (above). Try it at
> > your own risk.
>
> Thanks for this, it's a good start to getting top working under Cygwin.
>
> My question is that when you run the Configure script what do give as
> the 'appropriate module' for the machine? I've used 'linux' but I wonder
> if there is a better option, or whether we should invent a Cygwin
> machine definition?

'linux' seemed to work for me.  I've had to comment out some
linux-specific stuff, though (see patch:
http://cygwin.com/ml/cygwin/2002-07/msg01974.html ), so creating a cygwin
module might be a better long-term solution.

> Secondly, when it runs, I'm not convinced the figures are correct! For
> example, my setiathome process should show almost 100% cpu utilisation,
> but it shows 0%! Is this a refelction of my choice above, or problems
> with the /proc file system infotmation?

As I said, I haven't verified the correctness of the output.  As my
machine is mostly idle, the output looked plausible (compatible with that
of the Win2k Task Manager).  Now that I actually ran an experiment with a
CPU-intensive process, it looks like top downscales utilization by a
factor of 3 (again, on my machine and configuration).

> Hints and tips on this much appreciated.
> Regards, Tony.

The way top calculates CPU percentage is by dividing the accumulated
process time since last check by the wallclock time since last check.  As
far as I can see, the code itself looks correct.  Thus, the blame would
probably lie with either the /proc filesystem entries (particularly
/proc/$PID/stat) or the gettimeofday() implementation/granularity.
I'm sorry I don't have time to investigate further.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-25  8:55       ` Greg McCrory
@ 2002-07-25 13:37         ` Igor Pechtchanski
  2002-07-26  1:35           ` Dylan Cuthbert
  2002-07-26  6:30           ` Jim George
  0 siblings, 2 replies; 31+ messages in thread
From: Igor Pechtchanski @ 2002-07-25 13:37 UTC (permalink / raw)
  To: cygwin

On Thu, 25 Jul 2002, Greg McCrory wrote:

> At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
> >On Wed, 24 Jul 2002, Jim George wrote:
> >
> >Jim,
> >
> >I did a google search on "linux top cpu load".  Here's a top from the
> >first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> >It took about an hour to make it compile and run under cygwin 1.3.12-2 on
> >Win2k.  The patch is attached.
> >
> >Note: I just compiled and ran the code; I haven't verified the correctness
> >of the output.  It seemed to work without crashing, and the output looked
> >plausible.  I also haven't tested it on any system other than mine (above).
> >Try it at your own risk.
> >     Igor
>
> Notes on my quick attempt this morning:
>
> To get the ./Configure to run properly I needed a symbolic link to tcsh:
> ln -s /bin/tcsh /bin/csh

Right, I have that too (from way back, no wonder I forgot to mention it).

> Also chose module linux when asked.

Yep.  Again, should have said that.

> for owner, used SYSTEM instead of default root

chown and chgrp didn't seem to work for me at all.  However, I don't have
a CYGWIN variable, so that might be the reason.  I don't miss it, though.

> install script did not move the executable into the proper directory:

I used /usr/bin/install as the install command.

> ./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
> chown: changing ownership of `/usr/local/bin/top': No such file or directory
> chgrp: changing group of `/usr/local/bin/top': No such file or directory
> chmod: changing permissions of `/usr/local/bin/top': No such file or directory
> make: *** [install-top] Error 1

See http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN644
It may be necessary to use the local script after all, and re-write it to
boot.

> I was able to install it manually and it appears to work.
> GMc

Not quite correctly -- see
http://cygwin.com/ml/cygwin/2002-07/msg01995.html
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-25 13:37         ` Igor Pechtchanski
@ 2002-07-26  1:35           ` Dylan Cuthbert
  2002-07-26  6:30           ` Jim George
  1 sibling, 0 replies; 31+ messages in thread
From: Dylan Cuthbert @ 2002-07-26  1:35 UTC (permalink / raw)
  To: cygwin

> > To get the ./Configure to run properly I needed a symbolic link to tcsh:
> > ln -s /bin/tcsh /bin/csh

why not just install tcsh for cygwin?  It seems to be in the package list
now.

Regards
---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-25 13:37         ` Igor Pechtchanski
  2002-07-26  1:35           ` Dylan Cuthbert
@ 2002-07-26  6:30           ` Jim George
       [not found]             ` <OIENKAGCMBEDKDHGANIKKEONCGAA.john.r.morrison@ntlworld.com>
  2002-07-26 13:15             ` Igor Pechtchanski
  1 sibling, 2 replies; 31+ messages in thread
From: Jim George @ 2002-07-26  6:30 UTC (permalink / raw)
  To: Igor Pechtchanski; +Cc: cygwin

On Thu, 25 Jul 2002 11:57:51 -0400 (EDT)
Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:

> On Thu, 25 Jul 2002, Greg McCrory wrote:
> 
> > At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
> > >On Wed, 24 Jul 2002, Jim George wrote:
> > >
> > >Jim,
> > >
> > >I did a google search on "linux top cpu load".  Here's a top from the
> > >first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> > >It took about an hour to make it compile and run under cygwin 1.3.12-2 on
> > >Win2k.  The patch is attached.
> > >
> > >Note: I just compiled and ran the code; I haven't verified the correctness
> > >of the output.  It seemed to work without crashing, and the output looked
> > >plausible.  I also haven't tested it on any system other than mine (above).
> > >Try it at your own risk.
> > >     Igor
> >
> > Notes on my quick attempt this morning:
> >
> > To get the ./Configure to run properly I needed a symbolic link to tcsh:
> > ln -s /bin/tcsh /bin/csh
> 
> Right, I have that too (from way back, no wonder I forgot to mention it).
> 
> > Also chose module linux when asked.
> 
> Yep.  Again, should have said that.
> 
> > for owner, used SYSTEM instead of default root
> 
> chown and chgrp didn't seem to work for me at all.  However, I don't have
> a CYGWIN variable, so that might be the reason.  I don't miss it, though.
> 
> > install script did not move the executable into the proper directory:
> 
> I used /usr/bin/install as the install command.
> 
> > ./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
> > chown: changing ownership of `/usr/local/bin/top': No such file or directory
> > chgrp: changing group of `/usr/local/bin/top': No such file or directory
> > chmod: changing permissions of `/usr/local/bin/top': No such file or directory
> > make: *** [install-top] Error 1
> 
> See http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN644
> It may be necessary to use the local script after all, and re-write it to
> boot.
> 
> > I was able to install it manually and it appears to work.
> > GMc
> 
> Not quite correctly -- see
> http://cygwin.com/ml/cygwin/2002-07/msg01995.html
> 	Igor
Hi everyone,

	well I got as far as compiling and installing, in the same way that Greg did, but...

	When I run top I get the following error..

		top: proc filesystem not mounted on /proc
		     type = 6

	The output of mount is..

	C:\cygwin\usr\X11R6\lib\X11\fonts on /usr/X11R6/lib/X11/fonts type system (binmode)
	C:\cygwin\bin on /usr/bin type system (binmode)
	C:\cygwin\lib on /usr/lib type system (binmode)
	C:\cygwin on / type system (binmode)
	c: on /cygdrive/c type user (binmode,noumount)
	u: on /cygdrive/u type user (binmode,noumount)
	v: on /cygdrive/v type user (binmode,noumount)

	Can anyone tell me what I've done wrong?  Do I need to explicitly mount /proc?

jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
       [not found]             ` <OIENKAGCMBEDKDHGANIKKEONCGAA.john.r.morrison@ntlworld.com>
@ 2002-07-26  6:57               ` Jim George
  2002-07-26  7:17                 ` John Morrison
  0 siblings, 1 reply; 31+ messages in thread
From: Jim George @ 2002-07-26  6:57 UTC (permalink / raw)
  To: John Morrison; +Cc: cygwin

On Fri, 26 Jul 2002 10:23:11 +0100
"John Morrison" <john.r.morrison@ntlworld.com> wrote:

> > On Behalf Of Jim George
> >
> > On Thu, 25 Jul 2002 11:57:51 -0400 (EDT)
> > Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:
> >
> > > On Thu, 25 Jul 2002, Greg McCrory wrote:
> > >
> > > > At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
> > > > >On Wed, 24 Jul 2002, Jim George wrote:
> > > > >
> > > > >Jim,
> > > > >
> > > > >I did a google search on "linux top cpu load".  Here's a top from the
> > > > >first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> > > > >It took about an hour to make it compile and run under
> > cygwin 1.3.12-2 on
> > > > >Win2k.  The patch is attached.
> > > > >
> > > > >Note: I just compiled and ran the code; I haven't verified
> > the correctness
> > > > >of the output.  It seemed to work without crashing, and the
> > output looked
> > > > >plausible.  I also haven't tested it on any system other
> > than mine (above).
> > > > >Try it at your own risk.
> > > > >     Igor
> > > >
> > > > Notes on my quick attempt this morning:
> > > >
> > > > To get the ./Configure to run properly I needed a symbolic
> > link to tcsh:
> > > > ln -s /bin/tcsh /bin/csh
> > >
> > > Right, I have that too (from way back, no wonder I forgot to
> > mention it).
> > >
> > > > Also chose module linux when asked.
> > >
> > > Yep.  Again, should have said that.
> > >
> > > > for owner, used SYSTEM instead of default root
> > >
> > > chown and chgrp didn't seem to work for me at all.  However, I
> > don't have
> > > a CYGWIN variable, so that might be the reason.  I don't miss
> > it, though.
> > >
> > > > install script did not move the executable into the proper directory:
> > >
> > > I used /usr/bin/install as the install command.
> > >
> > > > ./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
> > > > chown: changing ownership of `/usr/local/bin/top': No such
> > file or directory
> > > > chgrp: changing group of `/usr/local/bin/top': No such file
> > or directory
> > > > chmod: changing permissions of `/usr/local/bin/top': No such
> > file or directory
> > > > make: *** [install-top] Error 1
> > >
> > > See http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN644
> > > It may be necessary to use the local script after all, and
> > re-write it to
> > > boot.
> > >
> > > > I was able to install it manually and it appears to work.
> > > > GMc
> > >
> > > Not quite correctly -- see
> > > http://cygwin.com/ml/cygwin/2002-07/msg01995.html
> > > 	Igor
> > Hi everyone,
> >
> > 	well I got as far as compiling and installing, in the same
> > way that Greg did, but...
> >
> > 	When I run top I get the following error..
> >
> > 		top: proc filesystem not mounted on /proc
> > 		     type = 6
> 
> /proc is virtual.  Make sure you have the latest version
> of cygwin (the dll).  If you wish, you can create a directory
> called /proc, but you don't have to.
> 
> J.
Thanks John, 

	but I'm running 1.3.12?

	Isn't that recent enough?

Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26  6:57               ` Jim George
@ 2002-07-26  7:17                 ` John Morrison
  2002-07-26  7:39                   ` Jim George
  0 siblings, 1 reply; 31+ messages in thread
From: John Morrison @ 2002-07-26  7:17 UTC (permalink / raw)
  To: cygwin


> 	but I'm running 1.3.12?
> 
> 	Isn't that recent enough?

Don't know.  I'm running 1.3.12-2 and I know it's there.

$ ls /proc/
1540  1808  2536  2616  2660  2684  2848     meminfo   stat    version
1764  2444  2592  2636  2680  2712  loadavg  registry  uptime

J.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26  7:17                 ` John Morrison
@ 2002-07-26  7:39                   ` Jim George
  2002-07-26  7:40                     ` John Morrison
  2002-07-26 14:22                     ` Chris January
  0 siblings, 2 replies; 31+ messages in thread
From: Jim George @ 2002-07-26  7:39 UTC (permalink / raw)
  To: cygwin

On Fri, 26 Jul 2002 11:15:19 +0100
"John Morrison" <john.r.morrison@ntlworld.com> wrote:

> 
> > 	but I'm running 1.3.12?
> > 
> > 	Isn't that recent enough?
> 
> Don't know.  I'm running 1.3.12-2 and I know it's there.
> 
> $ ls /proc/
> 1540  1808  2536  2616  2660  2684  2848     meminfo   stat    version
> 1764  2444  2592  2636  2680  2712  loadavg  registry  uptime
> 
> J.
> 
Don't get me wrong../proc exists and looks very similar to yours, but I get that error (i.e. the complaint that /proc is not mounted) whenever I run top.

Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26  7:39                   ` Jim George
@ 2002-07-26  7:40                     ` John Morrison
  2002-07-26 16:35                       ` Chris January
  2002-07-26 14:22                     ` Chris January
  1 sibling, 1 reply; 31+ messages in thread
From: John Morrison @ 2002-07-26  7:40 UTC (permalink / raw)
  To: Jim George, cygwin

> on Behalf Of Jim George
> 
> On Fri, 26 Jul 2002 11:15:19 +0100
> "John Morrison" <john.r.morrison@ntlworld.com> wrote:
> > 
> > > 	but I'm running 1.3.12?
> > > 
> > > 	Isn't that recent enough?
> > 
> > Don't know.  I'm running 1.3.12-2 and I know it's there.
> > 
> > $ ls /proc/
> > 1540  1808  2536  2616  2660  2684  2848     meminfo   stat    version
> > 1764  2444  2592  2636  2680  2712  loadavg  registry  uptime
> > 
> > J.
> > 
> Don't get me wrong../proc exists and looks very similar to yours, 
> but I get that error (i.e. the complaint that /proc is not 
> mounted) whenever I run top.

Oh, sorry, missread.  I don't think I can help then :(

J.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26  6:30           ` Jim George
       [not found]             ` <OIENKAGCMBEDKDHGANIKKEONCGAA.john.r.morrison@ntlworld.com>
@ 2002-07-26 13:15             ` Igor Pechtchanski
  2002-07-26 18:31               ` Jim George
  1 sibling, 1 reply; 31+ messages in thread
From: Igor Pechtchanski @ 2002-07-26 13:15 UTC (permalink / raw)
  To: cygwin

Jim,
First off, it would be nice if your reply went directly to the list
instead of to me personally.  This is less of a criticism for you, and
more of a note to the list maintainers -- I thought the Reply-To:
field would be set correctly when a message comes from the list.  Oh,
well, I'll just set it manually.
More below...

On Thu, 25 Jul 2002, Jim George wrote:

> On Thu, 25 Jul 2002 11:57:51 -0400 (EDT)
> Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:
>
> > On Thu, 25 Jul 2002, Greg McCrory wrote:
> >
> > > At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
> > > >On Wed, 24 Jul 2002, Jim George wrote:
> > > >
> > > >Jim,
> > > >
> > > >I did a google search on "linux top cpu load".  Here's a top from the
> > > >first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> > > >It took about an hour to make it compile and run under cygwin 1.3.12-2 on
> > > >Win2k.  The patch is attached.
> > > >
> > > >Note: I just compiled and ran the code; I haven't verified the correctness
> > > >of the output.  It seemed to work without crashing, and the output looked
> > > >plausible.  I also haven't tested it on any system other than mine (above).
> > > >Try it at your own risk.
> > > >     Igor
> > >
> > > Notes on my quick attempt this morning:
> > >
> > > To get the ./Configure to run properly I needed a symbolic link to tcsh:
> > > ln -s /bin/tcsh /bin/csh
> >
> > Right, I have that too (from way back, no wonder I forgot to mention it).
> >
> > > Also chose module linux when asked.
> >
> > Yep.  Again, should have said that.
> >
> > > for owner, used SYSTEM instead of default root
> >
> > chown and chgrp didn't seem to work for me at all.  However, I don't have
> > a CYGWIN variable, so that might be the reason.  I don't miss it, though.
> >
> > > install script did not move the executable into the proper directory:
> >
> > I used /usr/bin/install as the install command.
> >
> > > ./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
> > > chown: changing ownership of `/usr/local/bin/top': No such file or directory
> > > chgrp: changing group of `/usr/local/bin/top': No such file or directory
> > > chmod: changing permissions of `/usr/local/bin/top': No such file or directory
> > > make: *** [install-top] Error 1
> >
> > See http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN644
> > It may be necessary to use the local script after all, and re-write it to
> > boot.
> >
> > > I was able to install it manually and it appears to work.
> > > GMc
> >
> > Not quite correctly -- see
> > http://cygwin.com/ml/cygwin/2002-07/msg01995.html
> > 	Igor
> Hi everyone,
>
> 	well I got as far as compiling and installing, in the same way
>       that Greg did, but...
>
> 	When I run top I get the following error..
>
> 		top: proc filesystem not mounted on /proc
> 		     type = 6
>
> 	The output of mount is..
> [snip]
> 	Can anyone tell me what I've done wrong?  Do I need to explicitly
>       mount /proc?

No, /proc is a virtual filesystem that is already mounted.  However, top
checks something called a PROC_SUPER_MAGIC, which is a compile-time
constant, but seems to be different for every system.  The value in the
patch is for my system only (as I repeatedly said).  To determine what the
value is on your system, edit machine.c, and insert fprintf(stderr, "
type=%x\n", sb.f_type); in machine_init, right after it prints out the
above error message (but before the return).  Then recompile and run.
It'll still fail, but now you'll know what the value of PROC_SUPER_MAGIC
is for your system.  Edit machine.c and change the #define of
PROC_SUPER_MAGIC from 0x9fa0 (the value for my system) to whatever it is
on yours.  Recompile, and top should work.
I know this is tedious and non-portable.  Someone who knows how the value
is actually derived on each machine can come up with a better way.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-24  5:59 a way to read the current cpu load from the shell or via a cmdline utility in cygwin? Dylan Cuthbert
  2002-07-24  6:32 ` Gunnar Norling
  2002-07-24  6:45 ` John Morrison
@ 2002-07-26 13:48 ` Chris January
  2002-07-27  6:26   ` Dylan Cuthbert
  2 siblings, 1 reply; 31+ messages in thread
From: Chris January @ 2002-07-26 13:48 UTC (permalink / raw)
  To: cygwin

> Hi there,
>
> I've searched through the archives but can't seem to find any mention of
> this, is there a way to display the cpu load via a shell utility?
>
> If not, can someone point me to the posix function call (if it exists) so
I
> can write a little utility.  I want to do some load balanced compiles
across
> several machines by spawning the compile across the network via "make -j",
> and a wrapper for gcc, then use rsh (ssh or rexec) and network sharing to
do
> the compile.  The thing is I only want to use machines whose loads are
low.
>
> Of course, if a tool for this kind of thing already exists, then please
give
> me a pointer.
The procps tools from Linux have been ported to Cygwin and are available
here:
http://www.doc.ic.ac.uk/~ccj00/procps-010801/
Hopefully this should be included as an official package one day (who knows
when?).
If you have found a version of top that doesn't work with Cygwin, than can
you please e-mail it to me via private e-mail. Cygwin's /proc implementation
is design to be as compatible as possible with Linux's.

Chris




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26  7:39                   ` Jim George
  2002-07-26  7:40                     ` John Morrison
@ 2002-07-26 14:22                     ` Chris January
  2002-07-26 19:06                       ` Jim George
  1 sibling, 1 reply; 31+ messages in thread
From: Chris January @ 2002-07-26 14:22 UTC (permalink / raw)
  To: cygwin

> > > but I'm running 1.3.12?
> > >
> > > Isn't that recent enough?
> >
> > Don't know.  I'm running 1.3.12-2 and I know it's there.
> >
> > $ ls /proc/
> > 1540  1808  2536  2616  2660  2684  2848     meminfo   stat    version
> > 1764  2444  2592  2636  2680  2712  loadavg  registry  uptime
> >
> > J.
> >
> Don't get me wrong../proc exists and looks very similar to yours, but I
get that error (i.e. the complaint that /proc is not mounted) whenever I run
top.
I think this is because top is looking for a file in /proc that's not there.
Please send me the source package for the version of top you are using.
You can download a working version of top here:
http://www.doc.ic.ac.uk/~ccj00/procps-010801/

Chris



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-25  8:54       ` Tony Arnold
  2002-07-25 10:01         ` Igor Pechtchanski
@ 2002-07-26 15:24         ` Chris January
  2002-07-26 17:54           ` Christopher Faylor
  1 sibling, 1 reply; 31+ messages in thread
From: Chris January @ 2002-07-26 15:24 UTC (permalink / raw)
  To: cygwin

> Igor,
>
> > I did a google search on "linux top cpu load".  Here's a top
> > from the first match:
> > http://www.groupsys.com/topsrc/top-> 3.5beta9.tar.gz
> > It took
> > about an hour to make it compile and
> > run under cygwin 1.3.12-2 on Win2k.  The patch is attached.
> >
> > Note: I just compiled and ran the code; I haven't verified
> > the correctness of the output.  It seemed to work without
> > crashing, and the output looked plausible.  I also haven't
> > tested it on any system other than mine (above). Try it at
> > your own risk.
>
> Thanks for this, it's a good start to getting top working under Cygwin.
>
> My question is that when you run the Configure script what do give as
> the 'appropriate module' for the machine? I've used 'linux' but I wonder
> if there is a better option, or whether we should invent a Cygwin
> machine definition?
>
> Secondly, when it runs, I'm not convinced the figures are correct! For
> example, my setiathome process should show almost 100% cpu utilisation,
> but it shows 0%! Is this a refelction of my choice above, or problems
> with the /proc file system infotmation?
>
> Hints and tips on this much appreciated.
The values seem to be a factor of 10 out.
This is because Linux uses a value of 100 for HZ, whereas Cygwin has this
defined as 1000. The /proc implementation uses 100 and ignores the Cygwin
value.

Chris



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26  7:40                     ` John Morrison
@ 2002-07-26 16:35                       ` Chris January
  2002-07-27  7:05                         ` Jim George
  0 siblings, 1 reply; 31+ messages in thread
From: Chris January @ 2002-07-26 16:35 UTC (permalink / raw)
  To: cygwin

> > > > but I'm running 1.3.12?
> > > >
> > > > Isn't that recent enough?
> > >
> > > Don't know.  I'm running 1.3.12-2 and I know it's there.
> > >
> > > $ ls /proc/
> > > 1540  1808  2536  2616  2660  2684  2848     meminfo   stat    version
> > > 1764  2444  2592  2636  2680  2712  loadavg  registry  uptime
> > >
> > > J.
> > >
> > Don't get me wrong../proc exists and looks very similar to yours,
> > but I get that error (i.e. the complaint that /proc is not
> > mounted) whenever I run top.
Make sure you are using 1.3.12-2 and not 1.3.12-1 in which the /proc
filesystem is hopelessly broken.

Chris



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-26 15:24         ` Chris January
@ 2002-07-26 17:54           ` Christopher Faylor
  2002-07-26 17:58             ` Chris January
  0 siblings, 1 reply; 31+ messages in thread
From: Christopher Faylor @ 2002-07-26 17:54 UTC (permalink / raw)
  To: cygwin

On Fri, Jul 26, 2002 at 09:46:19PM +0100, Chris January wrote:
>The values seem to be a factor of 10 out.
>This is because Linux uses a value of 100 for HZ, whereas Cygwin has this
>defined as 1000. The /proc implementation uses 100 and ignores the Cygwin
>value.

Is the cygwin value wrong?  Should we change it?

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-26 17:54           ` Christopher Faylor
@ 2002-07-26 17:58             ` Chris January
  0 siblings, 0 replies; 31+ messages in thread
From: Chris January @ 2002-07-26 17:58 UTC (permalink / raw)
  To: cygwin

> >The values seem to be a factor of 10 out.
> >This is because Linux uses a value of 100 for HZ, whereas Cygwin has this
> >defined as 1000. The /proc implementation uses 100 and ignores the Cygwin
> >value.
>
> Is the cygwin value wrong?  Should we change it?
Which value you pick is completely arbitary. I chose 100 because that's the
same as Linux. I could just as easily re-write the /proc stuff to use HZ
from sys/param.h instead. The procps proc/sysinfo.c file has code to
automatically work out what value of HZ is being used by the kernel, so
existing binaries would still work without re-compilation.
The author of procps has this to say:
 * Some values in /proc are expressed in units of 1/HZ seconds, where HZ
 * is the kernel clock tick rate. One of these units is called a jiffy.
 * The HZ value used in the kernel may vary according to hacker desire.
 * According to Linus Torvalds, this is not true. He considers the values
 * in /proc as being in architecture-dependant units that have no relation
 * to the kernel clock tick rate. Examination of the kernel source code
 * reveals that opinion as wishful thinking.
So, no, I don't think it should be changed. Well written programs should be
able to cope with this. I will modify fhandler_process.cc and
fhandler_proc.cc to use HZ from sys/param.h.

Chris



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26 13:15             ` Igor Pechtchanski
@ 2002-07-26 18:31               ` Jim George
  2002-07-26 18:47                 ` Igor Pechtchanski
  0 siblings, 1 reply; 31+ messages in thread
From: Jim George @ 2002-07-26 18:31 UTC (permalink / raw)
  To: cygwin

On Fri, 26 Jul 2002 11:44:03 -0400 (EDT)
Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:

> Jim,
> First off, it would be nice if your reply went directly to the list
> instead of to me personally.  This is less of a criticism for you, and
> more of a note to the list maintainers -- I thought the Reply-To:
> field would be set correctly when a message comes from the list.  Oh,
> well, I'll just set it manually.
> More below...
> 
> On Thu, 25 Jul 2002, Jim George wrote:
> 
> > On Thu, 25 Jul 2002 11:57:51 -0400 (EDT)
> > Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:
> >
> > > On Thu, 25 Jul 2002, Greg McCrory wrote:
> > >
> > > > At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
> > > > >On Wed, 24 Jul 2002, Jim George wrote:
> > > > >
> > > > >Jim,
> > > > >
> > > > >I did a google search on "linux top cpu load".  Here's a top from the
> > > > >first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> > > > >It took about an hour to make it compile and run under cygwin 1.3.12-2 on
> > > > >Win2k.  The patch is attached.
> > > > >
> > > > >Note: I just compiled and ran the code; I haven't verified the correctness
> > > > >of the output.  It seemed to work without crashing, and the output looked
> > > > >plausible.  I also haven't tested it on any system other than mine (above).
> > > > >Try it at your own risk.
> > > > >     Igor
> > > >
> > > > Notes on my quick attempt this morning:
> > > >
> > > > To get the ./Configure to run properly I needed a symbolic link to tcsh:
> > > > ln -s /bin/tcsh /bin/csh
> > >
> > > Right, I have that too (from way back, no wonder I forgot to mention it).
> > >
> > > > Also chose module linux when asked.
> > >
> > > Yep.  Again, should have said that.
> > >
> > > > for owner, used SYSTEM instead of default root
> > >
> > > chown and chgrp didn't seem to work for me at all.  However, I don't have
> > > a CYGWIN variable, so that might be the reason.  I don't miss it, though.
> > >
> > > > install script did not move the executable into the proper directory:
> > >
> > > I used /usr/bin/install as the install command.
> > >
> > > > ./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
> > > > chown: changing ownership of `/usr/local/bin/top': No such file or directory
> > > > chgrp: changing group of `/usr/local/bin/top': No such file or directory
> > > > chmod: changing permissions of `/usr/local/bin/top': No such file or directory
> > > > make: *** [install-top] Error 1
> > >
> > > See http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN644
> > > It may be necessary to use the local script after all, and re-write it to
> > > boot.
> > >
> > > > I was able to install it manually and it appears to work.
> > > > GMc
> > >
> > > Not quite correctly -- see
> > > http://cygwin.com/ml/cygwin/2002-07/msg01995.html
> > > 	Igor
> > Hi everyone,
> >
> > 	well I got as far as compiling and installing, in the same way
> >       that Greg did, but...
> >
> > 	When I run top I get the following error..
> >
> > 		top: proc filesystem not mounted on /proc
> > 		     type = 6
> >
> > 	The output of mount is..
> > [snip]
> > 	Can anyone tell me what I've done wrong?  Do I need to explicitly
> >       mount /proc?
> 
> No, /proc is a virtual filesystem that is already mounted.  However, top
> checks something called a PROC_SUPER_MAGIC, which is a compile-time
> constant, but seems to be different for every system.  The value in the
> patch is for my system only (as I repeatedly said).  To determine what the
> value is on your system, edit machine.c, and insert fprintf(stderr, "
> type=%x\n", sb.f_type); in machine_init, right after it prints out the
> above error message (but before the return).  Then recompile and run.
> It'll still fail, but now you'll know what the value of PROC_SUPER_MAGIC
> is for your system.  Edit machine.c and change the #define of
> PROC_SUPER_MAGIC from 0x9fa0 (the value for my system) to whatever it is
> on yours.  Recompile, and top should work.
> I know this is tedious and non-portable.  Someone who knows how the value
> is actually derived on each machine can come up with a better way.
> 	Igor

Igor,

	I went to make the change to machine.c that you suggested but the entry is already there right before the error return.

	When I run top I get the type=6, so what is the number I should replace 0x9fa0 with, 0x0006?

Regards,

Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26 18:31               ` Jim George
@ 2002-07-26 18:47                 ` Igor Pechtchanski
  2002-07-27  7:00                   ` Jim George
  0 siblings, 1 reply; 31+ messages in thread
From: Igor Pechtchanski @ 2002-07-26 18:47 UTC (permalink / raw)
  To: cygwin

On Fri, 26 Jul 2002, Jim George wrote:

> On Fri, 26 Jul 2002 11:44:03 -0400 (EDT)
> Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:
>
> > On Thu, 25 Jul 2002, Jim George wrote:
> >
> > > > On Thu, 25 Jul 2002, Greg McCrory wrote:
> > > >
> > > > > At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
> > > > > >On Wed, 24 Jul 2002, Jim George wrote:
> > > > > >
> > > > > >Jim,
> > > > > >
> > > > > >I did a google search on "linux top cpu load".  Here's a top from the
> > > > > >first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> > > > > >It took about an hour to make it compile and run under cygwin 1.3.12-2 on
> > > > > >Win2k.  The patch is attached.
> > > > > >
> > > > > >Note: I just compiled and ran the code; I haven't verified the correctness
> > > > > >of the output.  It seemed to work without crashing, and the output looked
> > > > > >plausible.  I also haven't tested it on any system other than mine (above).
> > > > > >Try it at your own risk.
> > > > > >     Igor
> > > > >
> > > > > Notes on my quick attempt this morning:
> > > > >
> > > > > To get the ./Configure to run properly I needed a symbolic link to tcsh:
> > > > > ln -s /bin/tcsh /bin/csh
> > > >
> > > > Right, I have that too (from way back, no wonder I forgot to mention it).
> > > >
> > > > > Also chose module linux when asked.
> > > >
> > > > Yep.  Again, should have said that.
> > > >
> > > > > for owner, used SYSTEM instead of default root
> > > >
> > > > chown and chgrp didn't seem to work for me at all.  However, I don't have
> > > > a CYGWIN variable, so that might be the reason.  I don't miss it, though.
> > > >
> > > > > install script did not move the executable into the proper directory:
> > > >
> > > > I used /usr/bin/install as the install command.
> > > >
> > > > > ./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
> > > > > chown: changing ownership of `/usr/local/bin/top': No such file or directory
> > > > > chgrp: changing group of `/usr/local/bin/top': No such file or directory
> > > > > chmod: changing permissions of `/usr/local/bin/top': No such file or directory
> > > > > make: *** [install-top] Error 1
> > > >
> > > > See http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN644
> > > > It may be necessary to use the local script after all, and re-write it to
> > > > boot.
> > > >
> > > > > I was able to install it manually and it appears to work.
> > > > > GMc
> > > >
> > > > Not quite correctly -- see
> > > > http://cygwin.com/ml/cygwin/2002-07/msg01995.html
> > > >   Igor
> > > Hi everyone,
> > >
> > >     well I got as far as compiling and installing, in the same way
> > >       that Greg did, but...
> > >
> > >     When I run top I get the following error..
> > >
> > >             top: proc filesystem not mounted on /proc
> > >                  type = 6
> > >
> > >     The output of mount is..
> > > [snip]
> > >     Can anyone tell me what I've done wrong?  Do I need to explicitly
> > >       mount /proc?
> >
> > No, /proc is a virtual filesystem that is already mounted.  However, top
> > checks something called a PROC_SUPER_MAGIC, which is a compile-time
> > constant, but seems to be different for every system.  The value in the
> > patch is for my system only (as I repeatedly said).  To determine what the
> > value is on your system, edit machine.c, and insert fprintf(stderr, "
> > type=%x\n", sb.f_type); in machine_init, right after it prints out the
> > above error message (but before the return).  Then recompile and run.
> > It'll still fail, but now you'll know what the value of PROC_SUPER_MAGIC
> > is for your system.  Edit machine.c and change the #define of
> > PROC_SUPER_MAGIC from 0x9fa0 (the value for my system) to whatever it is
> > on yours.  Recompile, and top should work.
> > I know this is tedious and non-portable.  Someone who knows how the value
> > is actually derived on each machine can come up with a better way.
> >       Igor
>
> Igor,
>         I went to make the change to machine.c that you suggested but
> the entry is already there right before the error return.
>         When I run top I get the type=6, so what is the number I should
> replace 0x9fa0 with, 0x0006?
> Regards,
> Jim

Jim,
Right, sorry, I forgot that I included the printout in the patch...  Well,
that means less work for you. :-)
Yes, do replace 0x9fa0 with the value that was printed out (in your case,
6).  The printout is in hex, you can just add a 0x in front of it (i.e.,
0x6).  Adding leading 0's (e.g., 0x000006) won't make a difference.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26 14:22                     ` Chris January
@ 2002-07-26 19:06                       ` Jim George
  2002-07-26 19:33                         ` Chris January
  0 siblings, 1 reply; 31+ messages in thread
From: Jim George @ 2002-07-26 19:06 UTC (permalink / raw)
  To: cygwin

On Fri, 26 Jul 2002 19:21:01 +0100
"Chris January" <chris@atomice.net> wrote:

> > > > but I'm running 1.3.12?
> > > >
> > > > Isn't that recent enough?
> > >
> > > Don't know.  I'm running 1.3.12-2 and I know it's there.
> > >
> > > $ ls /proc/
> > > 1540  1808  2536  2616  2660  2684  2848     meminfo   stat    version
> > > 1764  2444  2592  2636  2680  2712  loadavg  registry  uptime
> > >
> > > J.
> > >
> > Don't get me wrong../proc exists and looks very similar to yours, but I
> get that error (i.e. the complaint that /proc is not mounted) whenever I run
> top.
> I think this is because top is looking for a file in /proc that's not there.
> Please send me the source package for the version of top you are using.
> You can download a working version of top here:
> http://www.doc.ic.ac.uk/~ccj00/procps-010801/
> 
> Chris
> 
Thanks that's excellent, why don't you include this in cygwin?

Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26 19:06                       ` Jim George
@ 2002-07-26 19:33                         ` Chris January
  0 siblings, 0 replies; 31+ messages in thread
From: Chris January @ 2002-07-26 19:33 UTC (permalink / raw)
  To: cygwin

> > > > > but I'm running 1.3.12?
> > > > >
> > > > > Isn't that recent enough?
> > > >
> > > > Don't know.  I'm running 1.3.12-2 and I know it's there.
> > > >
> > > > $ ls /proc/
> > > > 1540  1808  2536  2616  2660  2684  2848     meminfo   stat
version
> > > > 1764  2444  2592  2636  2680  2712  loadavg  registry  uptime
> > > >
> > > > J.
> > > >
> > > Don't get me wrong../proc exists and looks very similar to yours, but
I
> > get that error (i.e. the complaint that /proc is not mounted) whenever I
run
> > top.
> > I think this is because top is looking for a file in /proc that's not
there.
> > Please send me the source package for the version of top you are using.
> > You can download a working version of top here:
> > http://www.doc.ic.ac.uk/~ccj00/procps-010801/
> >
> > Chris
> >
> Thanks that's excellent, why don't you include this in cygwin?
I posted it to cygwin-apps and changed it to address the issues that were
raised, but as of yet it has not been included. There's not much more than
that I can do!

Chris



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a cmdline utility  in cygwin?
  2002-07-26 13:48 ` Chris January
@ 2002-07-27  6:26   ` Dylan Cuthbert
  0 siblings, 0 replies; 31+ messages in thread
From: Dylan Cuthbert @ 2002-07-27  6:26 UTC (permalink / raw)
  To: cygwin

Those are great! yes, they should be included in the cygwin package listing
asap.

Thanks.

---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com


"Chris January" <chris@atomice.net> wrote in message
news:00f701c234d0$6611ce00$0100a8c0@atomice.net...

> The procps tools from Linux have been ported to Cygwin and are available
> here:
> http://www.doc.ic.ac.uk/~ccj00/procps-010801/
> Hopefully this should be included as an official package one day (who
knows
> when?).
> If you have found a version of top that doesn't work with Cygwin, than can
> you please e-mail it to me via private e-mail. Cygwin's /proc
implementation
> is design to be as compatible as possible with Linux's.
>
> Chris
>
>
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26 18:47                 ` Igor Pechtchanski
@ 2002-07-27  7:00                   ` Jim George
  2002-07-27  8:45                     ` Chris January
  2002-07-27 19:55                     ` Igor Pechtchanski
  0 siblings, 2 replies; 31+ messages in thread
From: Jim George @ 2002-07-27  7:00 UTC (permalink / raw)
  To: cygwin

On Fri, 26 Jul 2002 18:07:01 -0400 (EDT)
Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:

> On Fri, 26 Jul 2002, Jim George wrote:
> 
> > On Fri, 26 Jul 2002 11:44:03 -0400 (EDT)
> > Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:
> >
> > > On Thu, 25 Jul 2002, Jim George wrote:
> > >
> > > > > On Thu, 25 Jul 2002, Greg McCrory wrote:
> > > > >
> > > > > > At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
> > > > > > >On Wed, 24 Jul 2002, Jim George wrote:
> > > > > > >
> > > > > > >Jim,
> > > > > > >
> > > > > > >I did a google search on "linux top cpu load".  Here's a top from the
> > > > > > >first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> > > > > > >It took about an hour to make it compile and run under cygwin 1.3.12-2 on
> > > > > > >Win2k.  The patch is attached.
> > > > > > >
> > > > > > >Note: I just compiled and ran the code; I haven't verified the correctness
> > > > > > >of the output.  It seemed to work without crashing, and the output looked
> > > > > > >plausible.  I also haven't tested it on any system other than mine (above).
> > > > > > >Try it at your own risk.
> > > > > > >     Igor
> > > > > >
> > > > > > Notes on my quick attempt this morning:
> > > > > >
> > > > > > To get the ./Configure to run properly I needed a symbolic link to tcsh:
> > > > > > ln -s /bin/tcsh /bin/csh
> > > > >
> > > > > Right, I have that too (from way back, no wonder I forgot to mention it).
> > > > >
> > > > > > Also chose module linux when asked.
> > > > >
> > > > > Yep.  Again, should have said that.
> > > > >
> > > > > > for owner, used SYSTEM instead of default root
> > > > >
> > > > > chown and chgrp didn't seem to work for me at all.  However, I don't have
> > > > > a CYGWIN variable, so that might be the reason.  I don't miss it, though.
> > > > >
> > > > > > install script did not move the executable into the proper directory:
> > > > >
> > > > > I used /usr/bin/install as the install command.
> > > > >
> > > > > > ./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
> > > > > > chown: changing ownership of `/usr/local/bin/top': No such file or directory
> > > > > > chgrp: changing group of `/usr/local/bin/top': No such file or directory
> > > > > > chmod: changing permissions of `/usr/local/bin/top': No such file or directory
> > > > > > make: *** [install-top] Error 1
> > > > >
> > > > > See http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN644
> > > > > It may be necessary to use the local script after all, and re-write it to
> > > > > boot.
> > > > >
> > > > > > I was able to install it manually and it appears to work.
> > > > > > GMc
> > > > >
> > > > > Not quite correctly -- see
> > > > > http://cygwin.com/ml/cygwin/2002-07/msg01995.html
> > > > >   Igor
> > > > Hi everyone,
> > > >
> > > >     well I got as far as compiling and installing, in the same way
> > > >       that Greg did, but...
> > > >
> > > >     When I run top I get the following error..
> > > >
> > > >             top: proc filesystem not mounted on /proc
> > > >                  type = 6
> > > >
> > > >     The output of mount is..
> > > > [snip]
> > > >     Can anyone tell me what I've done wrong?  Do I need to explicitly
> > > >       mount /proc?
> > >
> > > No, /proc is a virtual filesystem that is already mounted.  However, top
> > > checks something called a PROC_SUPER_MAGIC, which is a compile-time
> > > constant, but seems to be different for every system.  The value in the
> > > patch is for my system only (as I repeatedly said).  To determine what the
> > > value is on your system, edit machine.c, and insert fprintf(stderr, "
> > > type=%x\n", sb.f_type); in machine_init, right after it prints out the
> > > above error message (but before the return).  Then recompile and run.
> > > It'll still fail, but now you'll know what the value of PROC_SUPER_MAGIC
> > > is for your system.  Edit machine.c and change the #define of
> > > PROC_SUPER_MAGIC from 0x9fa0 (the value for my system) to whatever it is
> > > on yours.  Recompile, and top should work.
> > > I know this is tedious and non-portable.  Someone who knows how the value
> > > is actually derived on each machine can come up with a better way.
> > >       Igor
> >
> > Igor,
> >         I went to make the change to machine.c that you suggested but
> > the entry is already there right before the error return.
> >         When I run top I get the type=6, so what is the number I should
> > replace 0x9fa0 with, 0x0006?
> > Regards,
> > Jim
> 
> Jim,
> Right, sorry, I forgot that I included the printout in the patch...  Well,
> that means less work for you. :-)
> Yes, do replace 0x9fa0 with the value that was printed out (in your case,
> 6).  The printout is in hex, you can just add a 0x in front of it (i.e.,
> 0x6).  Adding leading 0's (e.g., 0x000006) won't make a difference.
> 	Igor
Thanks Igor,

	that did it.

	Were you aware that you had competition?  There's a package called procps by Chris January at http://www.doc.ic.ac.uk/~ccj00/procps-010801.

	Perhaps you could share experiences/code?

Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-26 16:35                       ` Chris January
@ 2002-07-27  7:05                         ` Jim George
  0 siblings, 0 replies; 31+ messages in thread
From: Jim George @ 2002-07-27  7:05 UTC (permalink / raw)
  To: cygwin

On Fri, 26 Jul 2002 21:48:32 +0100
"Chris January" <chris@atomice.net> wrote:

> > > > > but I'm running 1.3.12?
> > > > >
> > > > > Isn't that recent enough?
> > > >
> > > > Don't know.  I'm running 1.3.12-2 and I know it's there.
> > > >
> > > > $ ls /proc/
> > > > 1540  1808  2536  2616  2660  2684  2848     meminfo   stat    version
> > > > 1764  2444  2592  2636  2680  2712  loadavg  registry  uptime
> > > >
> > > > J.
> > > >
> > > Don't get me wrong../proc exists and looks very similar to yours,
> > > but I get that error (i.e. the complaint that /proc is not
> > > mounted) whenever I run top.
> Make sure you are using 1.3.12-2 and not 1.3.12-1 in which the /proc
> filesystem is hopelessly broken.
> 
> Chris
Looks like another download then ;)

Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-27  7:00                   ` Jim George
@ 2002-07-27  8:45                     ` Chris January
  2002-07-27 19:55                     ` Igor Pechtchanski
  1 sibling, 0 replies; 31+ messages in thread
From: Chris January @ 2002-07-27  8:45 UTC (permalink / raw)
  To: cygwin

> Were you aware that you had competition?  There's a package called procps
by Chris January at http://www.doc.ic.ac.uk/~ccj00/procps-010801.
>
> Perhaps you could share experiences/code?
procps is what I'm using to test the /proc implementation (i.e. if it works
with this - it works, anything else is an optional extra). However in the
future I'll also try to test against William LeFebvre's top as well. I have
a patch that makes the latter top report the correct values for CPU usage
which I will post to cygwin-patches.

Chris



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: a way to read the current cpu load from the shell or via a  cmdline utility in cygwin?
  2002-07-27  7:00                   ` Jim George
  2002-07-27  8:45                     ` Chris January
@ 2002-07-27 19:55                     ` Igor Pechtchanski
  1 sibling, 0 replies; 31+ messages in thread
From: Igor Pechtchanski @ 2002-07-27 19:55 UTC (permalink / raw)
  To: cygwin

On Sat, 27 Jul 2002, Jim George wrote:

> On Fri, 26 Jul 2002 18:07:01 -0400 (EDT)
> Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:
>
> > On Fri, 26 Jul 2002, Jim George wrote:
> >
> > > On Fri, 26 Jul 2002 11:44:03 -0400 (EDT)
> > > Igor Pechtchanski <pechtcha@cs.nyu.edu> wrote:
> > >
> > > > On Thu, 25 Jul 2002, Jim George wrote:
> > > >
> > > > > > On Thu, 25 Jul 2002, Greg McCrory wrote:
> > > > > >
> > > > > > > At 7/24/2002 11:38 PM -0400, Igor Pechtchanski wrote:
> > > > > > > >On Wed, 24 Jul 2002, Jim George wrote:
> > > > > > > >
> > > > > > > >Jim,
> > > > > > > >
> > > > > > > >I did a google search on "linux top cpu load".  Here's a top from the
> > > > > > > >first match: http://www.groupsys.com/topsrc/top-3.5beta9.tar.gz
> > > > > > > >It took about an hour to make it compile and run under cygwin 1.3.12-2 on
> > > > > > > >Win2k.  The patch is attached.
> > > > > > > >
> > > > > > > >Note: I just compiled and ran the code; I haven't verified the correctness
> > > > > > > >of the output.  It seemed to work without crashing, and the output looked
> > > > > > > >plausible.  I also haven't tested it on any system other than mine (above).
> > > > > > > >Try it at your own risk.
> > > > > > > >     Igor
> > > > > > >
> > > > > > > Notes on my quick attempt this morning:
> > > > > > >
> > > > > > > To get the ./Configure to run properly I needed a symbolic link to tcsh:
> > > > > > > ln -s /bin/tcsh /bin/csh
> > > > > >
> > > > > > Right, I have that too (from way back, no wonder I forgot to mention it).
> > > > > >
> > > > > > > Also chose module linux when asked.
> > > > > >
> > > > > > Yep.  Again, should have said that.
> > > > > >
> > > > > > > for owner, used SYSTEM instead of default root
> > > > > >
> > > > > > chown and chgrp didn't seem to work for me at all.  However, I don't have
> > > > > > a CYGWIN variable, so that might be the reason.  I don't miss it, though.
> > > > > >
> > > > > > > install script did not move the executable into the proper directory:
> > > > > >
> > > > > > I used /usr/bin/install as the install command.
> > > > > >
> > > > > > > ./install -o SYSTEM -m 4711 -g SYSTEM top /usr/local/bin
> > > > > > > chown: changing ownership of `/usr/local/bin/top': No such file or directory
> > > > > > > chgrp: changing group of `/usr/local/bin/top': No such file or directory
> > > > > > > chmod: changing permissions of `/usr/local/bin/top': No such file or directory
> > > > > > > make: *** [install-top] Error 1
> > > > > >
> > > > > > See http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN644
> > > > > > It may be necessary to use the local script after all, and re-write it to
> > > > > > boot.
> > > > > >
> > > > > > > I was able to install it manually and it appears to work.
> > > > > > > GMc
> > > > > >
> > > > > > Not quite correctly -- see
> > > > > > http://cygwin.com/ml/cygwin/2002-07/msg01995.html
> > > > > >   Igor
> > > > > Hi everyone,
> > > > >
> > > > >     well I got as far as compiling and installing, in the same way
> > > > >       that Greg did, but...
> > > > >
> > > > >     When I run top I get the following error..
> > > > >
> > > > >             top: proc filesystem not mounted on /proc
> > > > >                  type = 6
> > > > >
> > > > >     The output of mount is..
> > > > > [snip]
> > > > >     Can anyone tell me what I've done wrong?  Do I need to explicitly
> > > > >       mount /proc?
> > > >
> > > > No, /proc is a virtual filesystem that is already mounted.  However, top
> > > > checks something called a PROC_SUPER_MAGIC, which is a compile-time
> > > > constant, but seems to be different for every system.  The value in the
> > > > patch is for my system only (as I repeatedly said).  To determine what the
> > > > value is on your system, edit machine.c, and insert fprintf(stderr, "
> > > > type=%x\n", sb.f_type); in machine_init, right after it prints out the
> > > > above error message (but before the return).  Then recompile and run.
> > > > It'll still fail, but now you'll know what the value of PROC_SUPER_MAGIC
> > > > is for your system.  Edit machine.c and change the #define of
> > > > PROC_SUPER_MAGIC from 0x9fa0 (the value for my system) to whatever it is
> > > > on yours.  Recompile, and top should work.
> > > > I know this is tedious and non-portable.  Someone who knows how the value
> > > > is actually derived on each machine can come up with a better way.
> > > >       Igor
> > >
> > > Igor,
> > >         I went to make the change to machine.c that you suggested but
> > > the entry is already there right before the error return.
> > >         When I run top I get the type=6, so what is the number I should
> > > replace 0x9fa0 with, 0x0006?
> > > Regards,
> > > Jim
> >
> > Jim,
> > Right, sorry, I forgot that I included the printout in the patch...  Well,
> > that means less work for you. :-)
> > Yes, do replace 0x9fa0 with the value that was printed out (in your case,
> > 6).  The printout is in hex, you can just add a 0x in front of it (i.e.,
> > 0x6).  Adding leading 0's (e.g., 0x000006) won't make a difference.
> >       Igor
>
> Thanks Igor,
>         that did it.
>         Were you aware that you had competition?  There's a package
> called procps by Chris January at
> http://www.doc.ic.ac.uk/~ccj00/procps-010801.
>         Perhaps you could share experiences/code?
> Jim

Jim,
Yes, I saw the messages, thanks.  Contrary to the belief some people seem
to have, I'm not an author or maintainer of the top package - I just
looked on the net, found the source, and twiddled with it to make it
compile and run under cygwin.  I'm not even claiming it's the best out
there - it was the first match, that's all.  I'm sure Chris's tools are
better and more Cygwin-compatible.  My attempt was to fill the void, not
to provide the best there is.  I'm not even sure how most of the code
works - I'm only familiar with the parts I had to change to port it.  All
of my experiences are described right here on the list.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2002-07-27 18:23 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-24  5:59 a way to read the current cpu load from the shell or via a cmdline utility in cygwin? Dylan Cuthbert
2002-07-24  6:32 ` Gunnar Norling
2002-07-24  6:45 ` John Morrison
2002-07-25  1:57   ` Jim George
2002-07-25  6:01     ` Igor Pechtchanski
2002-07-25  8:54       ` Tony Arnold
2002-07-25 10:01         ` Igor Pechtchanski
2002-07-26 15:24         ` Chris January
2002-07-26 17:54           ` Christopher Faylor
2002-07-26 17:58             ` Chris January
2002-07-25  8:55       ` Greg McCrory
2002-07-25 13:37         ` Igor Pechtchanski
2002-07-26  1:35           ` Dylan Cuthbert
2002-07-26  6:30           ` Jim George
     [not found]             ` <OIENKAGCMBEDKDHGANIKKEONCGAA.john.r.morrison@ntlworld.com>
2002-07-26  6:57               ` Jim George
2002-07-26  7:17                 ` John Morrison
2002-07-26  7:39                   ` Jim George
2002-07-26  7:40                     ` John Morrison
2002-07-26 16:35                       ` Chris January
2002-07-27  7:05                         ` Jim George
2002-07-26 14:22                     ` Chris January
2002-07-26 19:06                       ` Jim George
2002-07-26 19:33                         ` Chris January
2002-07-26 13:15             ` Igor Pechtchanski
2002-07-26 18:31               ` Jim George
2002-07-26 18:47                 ` Igor Pechtchanski
2002-07-27  7:00                   ` Jim George
2002-07-27  8:45                     ` Chris January
2002-07-27 19:55                     ` Igor Pechtchanski
2002-07-26 13:48 ` Chris January
2002-07-27  6:26   ` Dylan Cuthbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).