[time/f14] Fix maximal RSS report

Petr Pisar ppisar at fedoraproject.org
Wed May 11 16:19:03 UTC 2011


commit 84bd7e93cab38d46dcb6ea75f65342cc7e575925
Author: Petr Písař <ppisar at redhat.com>
Date:   Wed May 11 15:30:51 2011 +0200

    Fix maximal RSS report

 time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch |   32 +++++++++++++++++++++
 time.spec                                         |    8 ++++-
 2 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch b/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
new file mode 100644
index 0000000..1f68f9b
--- /dev/null
+++ b/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
@@ -0,0 +1,32 @@
+From ad24a929bdcc15abae14a64ea21b821bcd8cb030 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Wed, 11 May 2011 15:19:11 +0200
+Subject: [PATCH] ru_maxrss is in kilobytes on Linux
+
+Since 2.6.32 Linux returns ru_maxrss in kilobytes. Not in pages.
+
+See http://lists.gnu.org/archive/html/bug-gnu-utils/2008-12/msg00047.html
+for discussion.
+---
+ time.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/time.c b/time.c
+index d15fee4..43aec0b 100644
+--- a/time.c
++++ b/time.c
+@@ -395,7 +395,11 @@ summarize (fp, fmt, command, resp)
+ 		       ptok ((UL) resp->ru.ru_ixrss) / MSEC_TO_TICKS (v));
+ 	      break;
+ 	    case 'M':		/* Maximum resident set size.  */
++#ifdef __linux__
++	      fprintf (fp, "%ld", resp->ru.ru_maxrss);
++#else
+ 	      fprintf (fp, "%lu", ptok ((UL) resp->ru.ru_maxrss));
++#endif
+ 	      break;
+ 	    case 'O':		/* Outputs.  */
+ 	      fprintf (fp, "%ld", resp->ru.ru_oublock);
+-- 
+1.7.4.4
+
diff --git a/time.spec b/time.spec
index 1483de8..47f9603 100644
--- a/time.spec
+++ b/time.spec
@@ -1,13 +1,15 @@
 Summary: A GNU utility for monitoring a program's use of system resources
 Name: time
 Version: 1.7
-Release: 37%{?dist}
+Release: 38%{?dist}
 License: GPLv2+
 Group: Applications/System
 Url: http://www.gnu.org/software/time/
 Source: ftp://prep.ai.mit.edu/pub/gnu/%{name}/%{name}-%{version}.tar.gz
 Patch0: time-1.7-destdir.patch
 Patch1: time-1.7-verbose.patch
+# Bug #702826
+Patch2: time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires(post): /sbin/install-info
 Requires(preun): /sbin/install-info
@@ -21,6 +23,7 @@ the results.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1 -b .ru_maxrss
 
 %build
 echo "ac_cv_func_wait3=\${ac_cv_func_wait3='yes'}" >> config.cache
@@ -51,6 +54,9 @@ fi
 %{_infodir}/time.info*
 
 %changelog
+* Wed May 11 2011 Petr Pisar <ppisar at redhat.com> - 1.7-38
+- Fix maximal RSS report (bug #702826)
+
 * Tue Aug 11 2009 Roman Rakus <rrakus at redhat.com> - 1.7-37
 - Don't print errors in post and preun sections (#515936)
 


More information about the scm-commits mailing list