From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11140 invoked by alias); 26 Jul 2002 15:44:08 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 11101 invoked from network); 26 Jul 2002 15:44:04 -0000 Received: from unknown (HELO slinky.cs.nyu.edu) (128.122.20.14) by sources.redhat.com with SMTP; 26 Jul 2002 15:44:04 -0000 Received: from localhost (pechtcha@localhost) by slinky.cs.nyu.edu (8.11.6+Sun/8.11.6) with ESMTP id g6QFi3U12919 for ; Fri, 26 Jul 2002 11:44:04 -0400 (EDT) X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Fri, 26 Jul 2002 13:15:00 -0000 From: Igor Pechtchanski Reply-To: cygwin@cygwin.com To: cygwin@cygwin.com Subject: Re: a way to read the current cpu load from the shell or via a cmdline utility in cygwin? In-Reply-To: <20020725220930.3ab7a24c.jim.george@blueyonder.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-07/txt/msg02092.txt.bz2 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 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/