Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-WM-Posted-At: avacado.atomice.net; Fri, 26 Jul 02 22:27:58 +0100 Message-ID: <003f01c234eb$5036e910$0100a8c0@atomice.net> From: "Chris January" To: References: <31CB870AD5AA384BB5419025DD9F7A84104345 AT dailymail DOT cfs DOT ac DOT uk> <004201c234e5$7ec72250$0100a8c0 AT atomice DOT net> <20020726212251 DOT GB3404 AT redhat DOT com> Subject: Re: a way to read the current cpu load from the shell or via a cmdline utility in cygwin? Date: Fri, 26 Jul 2002 22:27:58 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 > >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/