From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 60492b88 for ; Mon, 24 Feb 2020 19:41:15 +0000 (UTC) Received: (qmail 23332 invoked by alias); 24 Feb 2020 19:41:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45489 Received: (qmail 9787 invoked by uid 1010); 24 Feb 2020 19:41:10 -0000 X-Qmail-Scanner-Diagnostics: from relay7-d.mail.gandi.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25731. spamassassin: 3.4.2. Clear:RC:0(217.70.183.200):SA:0(-2.6/5.0):. Processed in 4.129916 secs); 24 Feb 2020 19:41:10 -0000 X-Envelope-From: stephane@chazelas.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _nblcust.gandi.net designates 217.70.183.200 as permitted sender) X-Originating-IP: 2.121.21.5 Date: Mon, 24 Feb 2020 19:40:21 +0000 From: Stephane Chazelas To: Zsh hackers list Subject: wrong unit for TIMEFMT=%M Message-ID: <20200224194021.kibawzliyystsu7o@chazelas.org> Mail-Followup-To: Zsh hackers list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20180716 TIMEFMT=%M is meant to report memory usage in KiB, but it's not the case in Linux and FreeBSD at least. It seems like zsh's TIMEFMT has had a tormented history. For %M, 2.00.03 had case 'M': fprintf(stderr,"%ld",ru->ru_maxrss); break In 2.2, that changed to #if sun case 'M': fprintf(stderr,"%ld",ru->ru_maxrss*pk); break; #else fprintf(stderr, "%ld", ru->ru_maxrss / 1024); #endif (pk being the number of KiB per page). It seemed to disappear altogether in 2.6 and came back circa 4.0.4 as fprintf(stderr, "%ld", ru->ru_maxrss / 1024); GNU time's configure.ac has: # What memory units are reported by getrusage(2) ? warn_getrusage_mem_units= if test -z "$time_getrusage_mem_units" ; then # if envvar 'time_getrusage_mem_units' isn't set, # autodetect based on OS. case "$host_os" in minix*|aix*|*bsd*|linux*|gnu*) time_getrusage_mem_units=kb ;; macos*|darwin*) time_getrusage_mem_units=bytes ;; solaris*) time_getrusage_mem_units=pages ;; # As a fallback, assume KB (the most common value). # Set the 'warn' variable to warn the user at the end # of ./configure *) time_getrusage_mem_units=kb warn_getrusage_mem_units=yes ;; esac fi Suggesting zsh is only correct on macos/darwin atm. -- Stephane