DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 47RKpQbo2320559
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=mk4E0vGV
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C48A385E44D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1724791885;
	bh=8aUTdpDpq954qS6QTQK+ed+CyzxOKreJOTf1i6DFoeI=;
	h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=mk4E0vGV5CylrtQXZU9Qva1bdly6aVVRNMJnn6LAaDW/nOZocjS6FXuVNTGGNNWI/
	 wwkp97PtljiizmU6sOmQj4MiykshaCbrfqbQJwOKwiVPMzorySGLpwfP/OU9ROIJRq
	 dsrI5D0/5BRV8JyaBHwX6TWFlWvcWYkkg069nO3M=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26370385EC3F
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 26370385EC3F
ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1724791829; cv=pass;
 b=gGikZ7zv45NZe1Dhy4MqFknTfyYQWulOYVbeeJJrimkH7EI9KHpq+N86SEK3tgW3fRmtS6gptMXiUB26AowTd1ynI0vcvl5Yoz+pTceVkQJRDGg4/2iRMs1jAsTE/9NHcTYOYWvyrKYNa7ubADNQKtKkA6IztV0Cjj5nx3OUpfM=
ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key;
 t=1724791829; c=relaxed/simple;
 bh=WQTm2J3eHhte56FHDWHTmoBpF7NRsdVi+U0AgKKovSQ=;
 h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
 b=vx3r76ATuf9VSfuyIGk526BlDAkAcT7ssGI/WY60W2BYdQ7pipsaA3NkzjVwK8ZN6EM6p7qhmSzAcoAiboryoVChmjasaSITO5TLQxExE/7Tyyxg5ZRF3mQQr8zZYpab6+WzfYhGbYbvRJhZc8fFAul6LWfpsgUWqaGkYpa6SYo=
ARC-Authentication-Results: i=2; server2.sourceware.org
X-Sender-Id: dreamhost|x-authsender|gisburn@nrubsig.org
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1724791823; a=rsa-sha256;
 cv=none;
 b=QvGv8TFLPjvJuXd0BnKKBtIVHsmMyXX81tHQ/yRPG59DU1W5dNhF4RmoMeuuCUhFc2aOMv
 prxJmCB3B2dsTRFMi/E4adYkuNeQqsjgxilJmZylO1cel97HNkUpK9f9+tdOZ8VN/JKvWB
 sWEH0BRBkfgQoRktB0OHSCSV91oT13tENroD50PGrgHhqJys9an/Z72j9FV9jSWbyNu37K
 y4TYR3l5WRSNIHfsq3+CymffvJ07q1MVugc3t3xAIZCDPRRNdawP4C0luUw6LXeoCKkleA
 tLE3vrpgwL/6Faf9Wv++jfqMao8pQRa0nPIcIos7w2K4iBwCaVGej1E19AIOYA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1724791823;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=Le/X3nUyUBE52k0ua3G8/wlSrpQgrvFzLL/NhDkQS4I=;
 b=L559gIiZDL39YJESAC6gXmZxs7ep7T2fnh/o+LrTqlJYYeTn9Vcwr8AUCFt1x6hyYCLsMp
 bOp+bDKad5VwgMwRx07doBdjmQvCTQGMeOWl24QUecYn6MWVpkZh4jIgI/gqDg9RBq5q/Q
 80vSCIzuTVOtjm3IaC3FDURcPVWOkvjz1Gc9aR5O8yXwMl+NLtBHNwS+aP9bqjXRYpgpbS
 6V1VVTAIcJ+Pg0rnswByWwH3gXSn3G2UaKaFgi6PoO77qsmbuop0UYyRpH+SrbxxwGTkso
 IAbx+HKVKUMe6X1lr/8HpdFQX7G5CWQHZkCPO71cLBgS5v1t1EQQv85tTEw6OQ==
ARC-Authentication-Results: i=1; rspamd-5549cdcdbf-fdrp7;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=roland.mainz@nrubsig.org
X-Sender-Id: dreamhost|x-authsender|gisburn@nrubsig.org
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|gisburn@nrubsig.org
X-MailChannels-Auth-Id: dreamhost
X-Tangy-Well-Made: 69b254547171690f_1724791825044_1315586614
X-MC-Loop-Signature: 1724791825044:978056871
X-MC-Ingress-Time: 1724791825044
X-Gm-Message-State: AOJu0YxU1czNgj0h/rIwARo3vRZ0E2Wr2FYKijWY7oDbNmC26ythHL0y
 qGAqQ7WawDRjOl8yPTTKT1ODiGMFLF5EOJVSqPvk91/TzZY/mx4Yi0/JStkZNAQA9Lg/wW2lg91
 d8WCWDPyadVxXF1yvgQoBWP1+wN0=
X-Google-Smtp-Source: AGHT+IF82V8xm/rDombksA0wvR/sKrlrYIAzzqMZy7ripg+/MUz713YayHeDzopYn1MlsznzlFX2obxe7sKRH9nf0dA=
X-Received: by 2002:a05:6e02:b4c:b0:376:4049:69e5 with SMTP id
 e9e14a558f8ab-39e3c9ee23fmr195105415ab.23.1724791822999; Tue, 27 Aug 2024
 13:50:22 -0700 (PDT)
MIME-Version: 1.0
References: <CAN0SSYxv9A8V6gGppEid0LnjHJtY4isDUFY-ey=nbM9PaDo_8g@mail.gmail.com>
 <be924247-c927-4fd7-8673-3cab4172aae7@dronecode.org.uk>
 <2225cf8a-cb8a-6437-177d-9a83f7dec53c@cs.umass.edu>
In-Reply-To: <2225cf8a-cb8a-6437-177d-9a83f7dec53c@cs.umass.edu>
Date: Tue, 27 Aug 2024 22:49:57 +0200
X-Gmail-Original-Message-ID: <CAKAoaQkCZS+HW5Rk6_qNxNA66FPgzwy2gVOYZGkiGPzBQ9VY5A@mail.gmail.com>
Message-ID: <CAKAoaQkCZS+HW5Rk6_qNxNA66FPgzwy2gVOYZGkiGPzBQ9VY5A@mail.gmail.com>
Subject: Re: BUG: /usr/bin/uptime always reports 0/0/0 average
To: cygwin@cygwin.com
X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE,
 RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP,
 T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Roland Mainz via Cygwin <cygwin@cygwin.com>
Reply-To: Roland Mainz <roland.mainz@nrubsig.org>
Content-Type: text/plain; charset="utf-8"
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 47RKpQbo2320559

On Tue, Aug 27, 2024 at 6:29 PM Eliot Moss via Cygwin <cygwin@cygwin.com> wrote:
> On 8/27/2024 11:31 AM, Jon Turney via Cygwin wrote:
> > On 27/08/2024 09:21, Mark Liam Brown via Cygwin wrote:
> >> Greetings!
> >>
> >> /usr/bin/uptime always reports 0/0/0 average cpu load:
> >> $ uptime
> >>   10:09:01 up 15:59,  0 user,  load average: 0.00, 0.00, 0.00
> >>
> >> is this a known bug?
> >
> > Kind of.
> >
> > Due to windows API limitations, the current implementation has the short-coming that a process's first call to
> > getloadavg() does not update the globally-maintained loadavg data.
> >
> > (Because the Windows API cannot provide instantaneous cpu load, only over the period between two calls)
> >
> > (So e.g. if you run something like top in another terminal, you'll suddenly see uptime return more sensible values)
> >
> > See the discussion [1] for more context, and discussion of various approaches to fixing this, which petered out without
> > a patch to [2]...
> >
> > [1] https://cygwin.com/pipermail/cygwin-developers/2022-May/012569.html
> > [2] https://cygwin.com/cgit/newlib-cygwin/tree/winsup/cygwin/loadavg.cc
>
> Thank you for the explanation, Mark!
>
> I see that /proc/loadavg appears to get updated.  If one wants the information,
> is that a more reliable source than calling uptime for load averages?

What about adding a new cygwin daemon, or add a loadavg-thread to cygserver ?

----

Bye,
Roland
-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

