From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4301 invoked from network); 27 Mar 2023 00:56:01 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Mar 2023 00:56:01 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1679878561; b=eu26i8Z+vV83D10Swqtozu0oUzfx7aC962l2vmQJxPflgoCYOCX5tfbzdIY11bIqhOUCLd7aQq 4rpUNjlmHynsIU9bO4HhouKanOhX0ImyAvQR58ZL3QYn+Wn/wGztpc+Cck4fmQU8Arr4lmUE1G Moz5a4PY/1n5oh+baaVGY9vJxskDqB3T+eQrbcc3/Zh/5Fja2FIR8oljXl/tTJ+M7/Ttsd1Wvi vwvQRf0oP89E8hq3CQBMvw/hZqBzMittwLhqCwZIemQzeEw8+B++lT2YzlIwORrkqi87+HYDJf wNpcR93QRmdJyQxln/89Pv5CRNmQO8a2x6pk8pYutReUDQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd00011-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.11; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1679878561; bh=SYnZCCeMiscqDkPj/6fLlWWEWw0natSNuDSfVwAju9c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=aEb1iSDkcZPqIgyUfDFW9y1CL69uoRXFs43h8FQSYuJZNRgMdVSDoL1Xem/I5ZDIy0nbhmFcAN adGYundMOBQvBK/6w2w9Bq/sis7+eoxp6mvov4B2A2s6VmBEf9VfEp4OzSQ27JAUbkh5AG4tNg 9yWTVSOjAqn34Nt2ww2EoYJJMGjWpS2zIJpYVRTwO4wk4+Bt6wRxR4yBNq+DwAYrjNuvgOD8+V Q9DmF3bPJE0xIBMmk8Qx80YMgOFzp67cQQf6pN0zreccrqpbteYLdJ8hWAXsFHox2KYoPT4oMf 4/qqpEDy11isRIDA6mSt7E1qpALnSaYDaEIKFD3N9XjEMQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=4waeTp2fSVgVkhk2tt3BhpeRMXoMFqbRqVK8sKrCbBQ=; b=CmguZpRaBdKZusFolEny9WUU3J /vUtZB97teEGzo4ektI3/rh5i7pvnWlqZsUAm33tDDCto3DFRBq3xzru8FemnDBKEpaotNDojC0cj QKCxG+K9v/1cLMFEs8gVhThQWGTE8uwaYntJrxcSG0+xKx424GUS+1EwkISTOi0UuqsKIBFc5pxad mShzdN7P9ZlqCiY3JFiH3b8TVqHN62P0mTG8t78Wl7ml85/4KSucX5ZJoSBHHhtvw5QuSzqB7B7FY /HN4vefPsK++hVXA9COm+RRMbH7LN10z5l2oVArI03zmiS4TeBFTrAKxDnwYqsVljk7VXLq/ezCzV HVtox+Zw==; Received: by zero.zsh.org with local id 1pgb9U-000NsT-T9; Mon, 27 Mar 2023 00:56:00 +0000 Authentication-Results: zsh.org; iprev=pass (snd00011-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.11; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd00011-bg.im.kddi.ne.jp ([27.86.113.11]:22561 helo=dfmta0007.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1pgb8x-000NZV-QG; Mon, 27 Mar 2023 00:55:29 +0000 Received: from mail.biglobe.ne.jp by omta0007.biglobe.ne.jp with ESMTP id <20230327005522595.BKTG.41306.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Mon, 27 Mar 2023 09:55:22 +0900 From: Jun T Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: Documentation of the TIMEFMT variable Date: Mon, 27 Mar 2023 09:55:22 +0900 References: <20230203205244.bfq7a3zqcs64rtbe@chazelas.org> <22159-1679669011.740622@zxQ6.l-QA.Tf8F> To: zsh-workers@zsh.org In-Reply-To: <22159-1679669011.740622@zxQ6.l-QA.Tf8F> Message-Id: X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 51604 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: > 2023/03/24 23:43=E3=80=81Oliver Kiddle =E3=81=AE=E3=83=A1=E3= =83=BC=E3=83=AB: >> Is there anyone who can confirm that ru_maxrss is set to zero? >> If it is always zero, then we need not bother with page to KB = conversion. >=20 > It does appear to always be zero. Thanks. I hope the following is enough: diff --git a/Src/jobs.c b/Src/jobs.c index 59ddd952e..4d7172550 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -888,8 +888,13 @@ printtime(struct timeval *real, child_times_t *ti, = char *desc) break; #endif #ifdef HAVE_STRUCT_RUSAGE_RU_MAXRSS +#ifdef RU_MAXRSS_IS_IN_BYTES +# define MAXRSS_IN_KB(x) ((x)/1024) +#else +# define MAXRSS_IN_KB(x) (x) +#endif case 'M': - fprintf(stderr, "%ld", ti->ru_maxrss / 1024); + fprintf(stderr, "%ld", MAXRSS_IN_KB(ti->ru_maxrss)); break; #endif #ifdef HAVE_STRUCT_RUSAGE_RU_MAJFLT @@ -1036,7 +1041,7 @@ should_report_time(Job j) =20 #ifdef HAVE_GETRUSAGE if (reportmemory >=3D 0 && - j->procs->ti.ru_maxrss / 1024 > reportmemory) + MAXRSS_IN_KB(j->procs->ti.ru_maxrss) > reportmemory) return 1; #endif =20 diff --git a/configure.ac b/configure.ac index f340d2993..e6ced85d9 100644 --- a/configure.ac +++ b/configure.ac @@ -1965,6 +1965,15 @@ if test x$ac_cv_func_getrusage =3D xyes; then #endif #include ]) fi +dnl On some OSes (only macOS?) ru_maxrss is in bytes (not in = kilobytes). +dnl Solaris uses pages as the unit, but ru_maxrss is set to zero = anyway. +AH_TEMPLATE(RU_MAXRSS_IS_IN_BYTES, +[Define to 1 if ru_maxrss in struct rusage is in bytes.]) +case "$host_os" in + darwin*) + AC_DEFINE(RU_MAXRSS_IS_IN_BYTES) + ;; +esac =20 =20 dnl --------------------------------------------