This is the mail archive of the
mailing list for the Cygwin project.
Re: uptime not reporting CPU usage on Windows 7 (Possibly only when running in VMWare)
- From: Andy Koppe <andy dot koppe at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 1 Jan 2011 14:08:35 +0000
- Subject: Re: uptime not reporting CPU usage on Windows 7 (Possibly only when running in VMWare)
- References: <email@example.com> <4D1CA8C0.firstname.lastname@example.org> <email@example.com> <AANLkTi=+Ps6YkQcvRMOcOCFpJEo_ZQHvMb1A2qS=M90e@mail.gmail.com> <firstname.lastname@example.org> <AANLkTimQzaxEOqyUVr6REL_xFsqYYYZ_HbRAhe-DtzsR@mail.gmail.com> <email@example.com> <AANLkTimg7zB__vPeJnQJUWf8vRb_O932xTrmf6oDyvy9@mail.gmail.com> <firstname.lastname@example.org> <AANLkTimtrk5boR8q2iPnFu=_viuJK_nggN=4HauZ4rnw@mail.gmail.com> <email@example.com>
On 31 December 2010 18:22, Andrew DeFaria wrote:
> I do not imply the devs are ignorant - just busy perhaps.
Good. If you'd also contemplated the possibility that the current
state was deliberately decided on as the least bad solution, you might
have written your complaint in more temperate language.
> Any other negative things are things you're making up in
> your own mind.
It shouldn't be such a surprise that words can be read differently
than they were intended if they're not chosen carefully.
>> Well, if you take the 0% at face value even though you know the
>> machine is doing something, you're being rather silly.
> There is absolutely no reason to assume that 0% doesn't mean 0%. Yeah sure
> you can do some measurements and the like and pretty quickly come to the
> realization that 0% doesn't really mean 0%?
If you can't accept that 0% is easier to recognise as fake than
current load, we'll just have to agree to disagree.
> But really, why are your fighting me on this?
Yeah, I'm wondering that myself.
> Why not simply make it better or at least make it something
> that nobody could mistake for simply a machine is not busy?
Because it's not that simple. Removing /proc/loadavg would be nice,
but would break any stuff that expects it to be there. Changing to
out-of-range values would also make some sense, but would break stuff
that depends on the values being in range.
If you want to contribute something more than opinions to this thread,
you could go and trawl the mail archives for why the 0/0/0 solution
was chosen. According to the changelog, it was added in 2002. Perhaps
things have changed since then.
>> ÂAlso, load information is in
>> fact already available from /proc/stat. Here's how to interpret it:
>> http://www.linuxhowtos.org/System/procstat.htm. That's what 'top' uses
>> as well.
> Great, well then couldn't uptime (and top, etc.) use that?
As I'm sure you've read in the description, the numbers in the file
are aggregates since system startup. (On Cygwin, they're in
A percentage calculated directly from that obviously isn't what you
asked for, and it would become near-constant pretty quickly, so it
would be no use for seeing how your system is currently doing.
'top' obtains the current load by calculating the differences between
successive /proc/stat readings. That's why it pauses for a second
before starting to display data. Pausing like that is not an option
for the /proc/loadavg driver, because programs expect reads from that
file to return immediately.
Here's an idea though that might provide a sufficiently useful
/proc/loadavg without having a background process polling the
performance counters. Read the counters whenever /proc/loadavg or
/proc/stat is read, and keep the readings for the last fifteen minutes
in a buffer, while discarding readings that are needlessly close
together. Use those readings to calculate the 1min/5min/15min
Obviously the averages will be rubbish if /proc/loadavg hasn't been
read for a while, but the more often it's read, the better it gets. In
particular, if you just left 'top' running, you'd get increasingly
(Disclaimer: I'm not going to implement that.)
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple