Compare commits
No commits in common. 'i8c' and 'c9' have entirely different histories.
@ -1 +1,2 @@
|
||||
SOURCES/gpgkey-F576AAAC1B0FF849792D8CB129A794FD2272BC86.gpg
|
||||
SOURCES/time-1.9.tar.gz
|
||||
|
@ -1 +1,2 @@
|
||||
c4b0bd75047a865df9d8a7c9ab029db05e0b726c SOURCES/gpgkey-F576AAAC1B0FF849792D8CB129A794FD2272BC86.gpg
|
||||
75068c26abbed3ad3980685bae21d7202d288317 SOURCES/time-1.9.tar.gz
|
||||
|
@ -0,0 +1,34 @@
|
||||
From 6a5c4499aab677d19157c7adcf598d14267283c1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Mon, 16 Nov 2020 17:45:04 +0100
|
||||
Subject: [PATCH] Close outfp before exec
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When called with --outfile, we open an output file to which
|
||||
we log timing results. Close that descriptor in the child
|
||||
fork before exec'ing the process to be timed.
|
||||
|
||||
Reported-by: Ed Santiago <santiago@redhat.com>
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
src/time.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/time.c b/src/time.c
|
||||
index f76265a..2f2b702 100644
|
||||
--- a/src/time.c
|
||||
+++ b/src/time.c
|
||||
@@ -738,6 +738,8 @@ run_command (cmd, resp)
|
||||
error (EXIT_CANCELED, errno, "cannot fork");
|
||||
else if (pid == 0)
|
||||
{ /* If child. */
|
||||
+ if (outfp != stderr)
|
||||
+ fclose(outfp);
|
||||
/* Don't cast execvp arguments; that causes errors on some systems,
|
||||
versus merely warnings if the cast is left off. */
|
||||
execvp (cmd[0], cmd);
|
||||
--
|
||||
2.25.4
|
||||
|
@ -0,0 +1,32 @@
|
||||
From d8cf31417c84646497657280830c432b6f412495 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Mon, 18 Jun 2018 10:05:06 +0200
|
||||
Subject: [PATCH] Improve info directory index entry description
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Describing "time" as "time" is not explanatory. Use better
|
||||
description.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
doc/time.texi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/doc/time.texi b/doc/time.texi
|
||||
index 63d25b4..dac65b4 100644
|
||||
--- a/doc/time.texi
|
||||
+++ b/doc/time.texi
|
||||
@@ -28,7 +28,7 @@ Texts. A copy of the license is included in the section entitled
|
||||
|
||||
@dircategory Basics
|
||||
@direntry
|
||||
-* Time: (time). time
|
||||
+* Time: (time). GNU time utility.
|
||||
@end direntry
|
||||
|
||||
|
||||
--
|
||||
2.14.4
|
||||
|
@ -0,0 +1,189 @@
|
||||
From 9fd52d5705fad70c0cb4ad8d508596a488262acf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Mon, 13 Jul 2020 09:24:35 +0200
|
||||
Subject: [PATCH] Use kibibytes instead of kilobytes in a documentation
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch does not changes any output of the time program. It only
|
||||
clarifies a manual and the comments.
|
||||
|
||||
<https://lists.gnu.org/archive/html/bug-time/2020-07/msg00000.html>
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
configure.ac | 6 +++---
|
||||
doc/time.texi | 12 ++++++------
|
||||
src/rusage-kb.c | 4 ++--
|
||||
src/rusage-kb.h | 10 +++++-----
|
||||
src/time.c | 6 +++---
|
||||
tests/time-max-rss.sh | 4 ++--
|
||||
6 files changed, 21 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d2950bd..67738b5 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -90,7 +90,7 @@ if test -z "$time_getrusage_mem_units" ; then
|
||||
|
||||
solaris*) time_getrusage_mem_units=pages ;;
|
||||
|
||||
- # As a fallback, assume KB (the most common value).
|
||||
+ # As a fallback, assume KiB (the most common value).
|
||||
# Set the 'warn' variable to warn the user at the end
|
||||
# of ./configure
|
||||
*) time_getrusage_mem_units=kb
|
||||
@@ -104,7 +104,7 @@ case $time_getrusage_mem_units in
|
||||
kb)
|
||||
AC_DEFINE([GETRUSAGE_RETURNS_KB],[1],
|
||||
[Define to 1 if getrusage(2) on this systems returns
|
||||
- ru_maxrss in kilobytes])
|
||||
+ ru_maxrss in kibibytes])
|
||||
;;
|
||||
|
||||
bytes)
|
||||
@@ -140,7 +140,7 @@ AC_OUTPUT
|
||||
# Warn the user if getrusage(2) behaviour on this OS is unknown
|
||||
if test "$warn_getrusage_mem_units" ; then
|
||||
AC_MSG_WARN([unknown getrusage behavior on operating system '$host_os'.
|
||||
- Assuming Kilobytes.
|
||||
+ Assuming kibibytes.
|
||||
please report this with the output of 'uname -a' to
|
||||
bug-time@gnu.org])
|
||||
fi
|
||||
diff --git a/doc/time.texi b/doc/time.texi
|
||||
index dac65b4..3a05ed9 100644
|
||||
--- a/doc/time.texi
|
||||
+++ b/doc/time.texi
|
||||
@@ -241,22 +241,22 @@ times divied by the total running time.
|
||||
@table @code
|
||||
@item M
|
||||
Maximum resident set size of the process during its lifetime, in
|
||||
-Kilobytes.
|
||||
+kibibytes.
|
||||
|
||||
@item t
|
||||
-Average resident set size of the process, in Kilobytes.
|
||||
+Average resident set size of the process, in kibibytes.
|
||||
|
||||
@item K
|
||||
-Average total (data+stack+text) memory use of the process, in Kilobytes.
|
||||
+Average total (data+stack+text) memory use of the process, in kibibytes.
|
||||
|
||||
@item D
|
||||
-Average size of the process's unshared data area, in Kilobytes.
|
||||
+Average size of the process's unshared data area, in kibibytes.
|
||||
|
||||
@item p
|
||||
-Average size of the process's unshared stack, in Kilobytes.
|
||||
+Average size of the process's unshared stack, in kibibytes.
|
||||
|
||||
@item X
|
||||
-Average size of the process's shared text, in Kilobytes.
|
||||
+Average size of the process's shared text, in kibibytes.
|
||||
|
||||
@item Z
|
||||
System's page size, in bytes. This is a per-system constant, but
|
||||
diff --git a/src/rusage-kb.c b/src/rusage-kb.c
|
||||
index aad06b8..04352cd 100644
|
||||
--- a/src/rusage-kb.c
|
||||
+++ b/src/rusage-kb.c
|
||||
@@ -25,8 +25,8 @@
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
-/* Return the number of kilobytes corresponding to a number of pages PAGES.
|
||||
- (Actually, we use it to convert pages*ticks into kilobytes*ticks.)
|
||||
+/* Return the number of kibibytes corresponding to a number of pages PAGES.
|
||||
+ (Actually, we use it to convert pages*ticks into kibibytes*ticks.)
|
||||
|
||||
Try to do arithmetic so that the risk of overflow errors is minimized.
|
||||
This is funky since the pagesize could be less than 1K.
|
||||
diff --git a/src/rusage-kb.h b/src/rusage-kb.h
|
||||
index 4a53515..b7b1155 100644
|
||||
--- a/src/rusage-kb.h
|
||||
+++ b/src/rusage-kb.h
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef _RUSAGE_KB_
|
||||
#define _RUSAGE_KB_
|
||||
|
||||
-/* As of 2017, most kernels' getrusage(2) returns ru_maxrss in kilobytes:
|
||||
+/* As of 2017, most kernels' getrusage(2) returns ru_maxrss in kibibytes:
|
||||
Linux, Hurd, Free/Open/Net-BSD, MINIX, AIX7
|
||||
|
||||
OpenSolaris's getrusage(2) documents a return value in pages,
|
||||
@@ -32,20 +32,20 @@
|
||||
|
||||
#if GETRUSAGE_RETURNS_KB
|
||||
|
||||
-/* define as no-op, as RUSAGE values are already in KB */
|
||||
+/* define as no-op, as RUSAGE values are already in KiB */
|
||||
#define RUSAGE_MEM_TO_KB(x) (x)
|
||||
|
||||
#elif GETRUSAGE_RETURNS_BYTES
|
||||
|
||||
-/* Convert bytes to kilobytes */
|
||||
+/* Convert bytes to kibibytes */
|
||||
#define RUSAGE_MEM_TO_KB(x) ((x)/1024)
|
||||
|
||||
#elif GETRUSAGE_RETURNS_PAGES
|
||||
|
||||
-/* Convert bytes to kilobytes */
|
||||
+/* Convert bytes to kibibytes */
|
||||
#define RUSAGE_MEM_TO_KB(x) (ptok (x))
|
||||
|
||||
-/* A function to get the system's page size and convert pages to KB */
|
||||
+/* A function to get the system's page size and convert pages to KiB */
|
||||
unsigned long
|
||||
ptok (unsigned long pages);
|
||||
|
||||
diff --git a/src/time.c b/src/time.c
|
||||
index 7e07995..f76265a 100644
|
||||
--- a/src/time.c
|
||||
+++ b/src/time.c
|
||||
@@ -108,8 +108,8 @@ typedef RETSIGTYPE (*sighandler) ();
|
||||
and 100 on the sun4.
|
||||
|
||||
Some manuals have an apparent error, claiming that units for average
|
||||
- sizes are kb*sec. Judging by the contents of `struct rusage', it
|
||||
- looks like it should be kb*ticks, like on SunOS. Ticks/sec seems
|
||||
+ sizes are KiB*sec. Judging by the contents of `struct rusage', it
|
||||
+ looks like it should be KiB*ticks, like on SunOS. Ticks/sec seems
|
||||
to be (empirically):
|
||||
50 Mt. Xinu
|
||||
250 Ultrix (mips)
|
||||
@@ -412,7 +412,7 @@ linear_argv (argv)
|
||||
x == exit status of command
|
||||
|
||||
Various memory usages are found by converting from page-seconds
|
||||
- to kbytes by multiplying by the page size, dividing by 1024,
|
||||
+ to kibibytes by multiplying by the page size, dividing by 1024,
|
||||
and dividing by elapsed real time.
|
||||
|
||||
FP is the stream to print to.
|
||||
diff --git a/tests/time-max-rss.sh b/tests/time-max-rss.sh
|
||||
index 0adda5c..5ecd3f2 100755
|
||||
--- a/tests/time-max-rss.sh
|
||||
+++ b/tests/time-max-rss.sh
|
||||
@@ -27,7 +27,7 @@ fail=
|
||||
# The auxiliary program should be built and runnable
|
||||
time-aux || framework_failure_ "time-aux is missing/not runnable"
|
||||
|
||||
-# Get the baseline number of MAX-RSS kilobytes
|
||||
+# Get the baseline number of MAX-RSS kibibytes
|
||||
# use by the program when not allocating any extra memory
|
||||
env time -o mem-baseline -f "%M" time-aux \
|
||||
|| framework_failure_ "failed to run time/time-aux (baseline max-rss)"
|
||||
@@ -49,7 +49,7 @@ test "$b" -eq "0" && test "$c" -eq 0 \
|
||||
# There could be alot of variation between each invocation,
|
||||
# accept a reasonable range
|
||||
if test "$d" -ge 5000 && test "$d" -le 6000 ; then
|
||||
- : # acceptable values: 5000-6000 KB
|
||||
+ : # acceptable values: 5000-6000 KiB
|
||||
else
|
||||
cat<<EOF>&2
|
||||
time(1) failed to detect 5MB allcoation.
|
||||
--
|
||||
2.25.4
|
||||
|
@ -0,0 +1,17 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1
|
||||
|
||||
iQIcBAABCgAGBQJapvw2AAoJEAoRth02V7kBwpcP/3uhXpenR0/SAZ8HEUlD+fnV
|
||||
cSp+Yg8D0YGhs6thvVT7cNYWfAXeUeHPNRoHmMpvwGBktRDf5MPKA7v42d8peoVJ
|
||||
MpotpeoUHiGiw8KBDRMSBjFoZrn5hjM7FZDPFtrChVAor8FCw4mbMknK4KLrkmyt
|
||||
2B1M3PPVeQ/2m+sho+XKYZTIV4JIV9rbZn5fXjSnr3QhDGyeRgSip548LTD8Li97
|
||||
EquxdaPd9bibvBEH8ZX4+XG9qWKJyThA21VmBhrylwpFAj7W4yBPSaW3B7HRvuCY
|
||||
X65cpJem6JYSpe/Hh6rHQrFdIrw3X+cO9U3vpHQq4AfSaCLIfmWw8GAXE2+6btsz
|
||||
aDMDafQy4OaFo45TGURQ6V73aa9d5et7Rt6btmatNP+vG5pU9iSDK9ViN+AmX5CL
|
||||
wLTtWlUyAZDzLn5UuiIAtrLtY7UWD5EcyKVe9B8T9ypRk9oAxaLgIGToukeZN6Dk
|
||||
qa0AhE7xtxC0yxUPR1Pwdt7XYYpAP8/dL2hPX6jRtKnLkvMMwYheUARx60Wm9Y6W
|
||||
YcE5fI+f5PoZprCbC6skwQvNbT8KmJcDrefPlSSTvj0e10IB2HZ9O1M1vNNUDL66
|
||||
0zt2j4ddtyc1NG1fLRCF52XAfIqI5a983yD40CKSRqcG3bYcyygQBhGx34Ez0buQ
|
||||
YGWpJ6ZvDh8d8j77Z0n4
|
||||
=FnFy
|
||||
-----END PGP SIGNATURE-----
|
Loading…
Reference in new issue