[arch-commits] Commit in time/repos (16 files)

Stéphane Gaudreault stephane at archlinux.org
Wed Jan 25 01:42:56 UTC 2012


    Date: Tuesday, January 24, 2012 @ 20:42:55
  Author: stephane
Revision: 147242

archrelease: copy trunk to extra-i686, extra-x86_64

Added:
  time/repos/extra-i686/PKGBUILD
    (from rev 147241, time/trunk/PKGBUILD)
  time/repos/extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
    (from rev 147241, time/trunk/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch)
  time/repos/extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
    (from rev 147241, time/trunk/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch)
  time/repos/extra-i686/time.install
    (from rev 147241, time/trunk/time.install)
  time/repos/extra-x86_64/PKGBUILD
    (from rev 147241, time/trunk/PKGBUILD)
  time/repos/extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
    (from rev 147241, time/trunk/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch)
  time/repos/extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
    (from rev 147241, time/trunk/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch)
  time/repos/extra-x86_64/time.install
    (from rev 147241, time/trunk/time.install)
Deleted:
  time/repos/extra-i686/PKGBUILD
  time/repos/extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
  time/repos/extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
  time/repos/extra-i686/time.install
  time/repos/extra-x86_64/PKGBUILD
  time/repos/extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
  time/repos/extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
  time/repos/extra-x86_64/time.install

----------------------------------------------------------------------+
 extra-i686/PKGBUILD                                                  |   80 ++---
 extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch   |  144 +++++-----
 extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch         |   64 ++--
 extra-i686/time.install                                              |   40 +-
 extra-x86_64/PKGBUILD                                                |   80 ++---
 extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch |  144 +++++-----
 extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch       |   64 ++--
 extra-x86_64/time.install                                            |   40 +-
 8 files changed, 328 insertions(+), 328 deletions(-)

Deleted: extra-i686/PKGBUILD
===================================================================
--- extra-i686/PKGBUILD	2012-01-25 01:42:41 UTC (rev 147241)
+++ extra-i686/PKGBUILD	2012-01-25 01:42:55 UTC (rev 147242)
@@ -1,40 +0,0 @@
-# $Id$
-# Maintainer: Stéphane Gaudreault <stephane at archlinux.us>
-# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
-# Contributor: damir <damir at archlinux.org>
-
-pkgname=time
-pkgver=1.7
-pkgrel=5
-pkgdesc="Utility for monitoring a program's use of system resources"
-arch=('i686' 'x86_64')
-url="http://www.gnu.org/directory/time.html"
-license=('GPL')
-depends=('glibc')
-install=time.install
-source=(http://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz
-        time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
-        time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch)
-sha1sums=('dde0c28c7426960736933f3e763320680356cc6a'
-          'fff80e05dd41f0a59bb1f49d1c6e581d5e8e92e5'
-          'b2a909e1d92f7af1bc99a4524ad84d467ed79a06')
-
-
-build() {
-	cd "${srcdir}/${pkgname}-${pkgver}"
-   
-   # cf https://bugzilla.redhat.com/show_bug.cgi?id=527276
-   patch -Np1 -i ../time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
-
-   # cf https://bugzilla.redhat.com/show_bug.cgi?id=702826
-   patch -Np1 -i ../time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
-
-	./configure --prefix=/usr --infodir=/usr/share/info
-	make
-}
-
-package() {
-	cd "${srcdir}/${pkgname}-${pkgver}"
-
-	make exec_prefix="${pkgdir}/usr" infodir="${pkgdir}/usr/share/info" install
-}

Copied: time/repos/extra-i686/PKGBUILD (from rev 147241, time/trunk/PKGBUILD)
===================================================================
--- extra-i686/PKGBUILD	                        (rev 0)
+++ extra-i686/PKGBUILD	2012-01-25 01:42:55 UTC (rev 147242)
@@ -0,0 +1,40 @@
+# $Id$
+# Maintainer: Stéphane Gaudreault <stephane at archlinux.us>
+# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
+# Contributor: damir <damir at archlinux.org>
+
+pkgname=time
+pkgver=1.7
+pkgrel=6
+pkgdesc="Utility for monitoring a program's use of system resources"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/directory/time.html"
+license=('GPL')
+depends=('glibc')
+install=time.install
+source=(http://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz
+        time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
+        time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch)
+sha1sums=('dde0c28c7426960736933f3e763320680356cc6a'
+          'fff80e05dd41f0a59bb1f49d1c6e581d5e8e92e5'
+          'b2a909e1d92f7af1bc99a4524ad84d467ed79a06')
+
+
+build() {
+	cd "${srcdir}/${pkgname}-${pkgver}"
+   
+   # cf https://bugzilla.redhat.com/show_bug.cgi?id=527276
+   patch -Np1 -i ../time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
+
+   # cf https://bugzilla.redhat.com/show_bug.cgi?id=702826
+   patch -Np1 -i ../time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
+
+	./configure --prefix=/usr --infodir=/usr/share/info
+	make
+}
+
+package() {
+	cd "${srcdir}/${pkgname}-${pkgver}"
+
+	make exec_prefix="${pkgdir}/usr" infodir="${pkgdir}/usr/share/info" install
+}

Deleted: extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
===================================================================
--- extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch	2012-01-25 01:42:41 UTC (rev 147241)
+++ extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch	2012-01-25 01:42:55 UTC (rev 147242)
@@ -1,72 +0,0 @@
-From 0d743a7d946fe176a07baf2586a6af0e867fd89c Mon Sep 17 00:00:00 2001
-From: H.J. Lu <hongjiu.lu at intel.com>
-Date: Wed, 11 May 2011 16:19:55 +0200
-Subject: [PATCH] Recompute CPU usage at microsecond level
-
-If job finishes quickly, miliseconds arithmetic rounds to zero. If
-that happens, recalculate CPU usage ratio with microsecond accuracy
-to raise chance to get non-zero values.
----
- resuse.h |    2 ++
- time.c   |   15 +++++++++++++++
- 2 files changed, 17 insertions(+), 0 deletions(-)
-
-diff --git a/resuse.h b/resuse.h
-index 992143f..7a3ee66 100644
---- a/resuse.h
-+++ b/resuse.h
-@@ -33,9 +33,11 @@ struct timeval
- #if HAVE_SYS_RUSAGE_H
- /* This rusage structure measures nanoseconds instead of microseconds.  */
- # define TV_MSEC tv_nsec / 1000000
-+# define TV_USEC tv_nsec / 1000
- # include <sys/rusage.h>
- #else
- # define TV_MSEC tv_usec / 1000
-+# define TV_USEC tv_usec
- # if HAVE_WAIT3
- #  include <sys/resource.h>
- # else
-diff --git a/time.c b/time.c
-index 43aec0b..96cfdde 100644
---- a/time.c
-+++ b/time.c
-@@ -326,6 +326,8 @@ summarize (fp, fmt, command, resp)
- {
-   unsigned long r;		/* Elapsed real milliseconds.  */
-   unsigned long v;		/* Elapsed virtual (CPU) milliseconds.  */
-+  unsigned long ru;		/* Elapsed real microseconds.  */
-+  unsigned long vu;		/* Elapsed virtual (CPU) microseconds.  */
- 
-   if (verbose)
-   {
-@@ -350,6 +352,17 @@ summarize (fp, fmt, command, resp)
-   v = resp->ru.ru_utime.tv_sec * 1000 + resp->ru.ru_utime.TV_MSEC +
-     resp->ru.ru_stime.tv_sec * 1000 + resp->ru.ru_stime.TV_MSEC;
- 
-+  if (r == 0 && v == 0)
-+    {
-+      ru = resp->elapsed.tv_usec;
-+      vu = resp->ru.ru_utime.TV_USEC + resp->ru.ru_stime.TV_USEC;
-+    }
-+  else
-+    {
-+      ru = 0;
-+      vu = 0;
-+    }
-+
-   while (*fmt)
-     {
-       switch (*fmt)
-@@ -408,6 +421,8 @@ summarize (fp, fmt, command, resp)
- 	      /* % cpu is (total cpu time)/(elapsed time).  */
- 	      if (r > 0)
- 		fprintf (fp, "%lu%%", (v * 100 / r));
-+	      else if (ru > 0)
-+		fprintf (fp, "%lu%%", (vu * 100 / ru));
- 	      else
- 		fprintf (fp, "?%%");
- 	      break;
--- 
-1.7.4.4
-

Copied: time/repos/extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch (from rev 147241, time/trunk/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch)
===================================================================
--- extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch	                        (rev 0)
+++ extra-i686/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch	2012-01-25 01:42:55 UTC (rev 147242)
@@ -0,0 +1,72 @@
+From 0d743a7d946fe176a07baf2586a6af0e867fd89c Mon Sep 17 00:00:00 2001
+From: H.J. Lu <hongjiu.lu at intel.com>
+Date: Wed, 11 May 2011 16:19:55 +0200
+Subject: [PATCH] Recompute CPU usage at microsecond level
+
+If job finishes quickly, miliseconds arithmetic rounds to zero. If
+that happens, recalculate CPU usage ratio with microsecond accuracy
+to raise chance to get non-zero values.
+---
+ resuse.h |    2 ++
+ time.c   |   15 +++++++++++++++
+ 2 files changed, 17 insertions(+), 0 deletions(-)
+
+diff --git a/resuse.h b/resuse.h
+index 992143f..7a3ee66 100644
+--- a/resuse.h
++++ b/resuse.h
+@@ -33,9 +33,11 @@ struct timeval
+ #if HAVE_SYS_RUSAGE_H
+ /* This rusage structure measures nanoseconds instead of microseconds.  */
+ # define TV_MSEC tv_nsec / 1000000
++# define TV_USEC tv_nsec / 1000
+ # include <sys/rusage.h>
+ #else
+ # define TV_MSEC tv_usec / 1000
++# define TV_USEC tv_usec
+ # if HAVE_WAIT3
+ #  include <sys/resource.h>
+ # else
+diff --git a/time.c b/time.c
+index 43aec0b..96cfdde 100644
+--- a/time.c
++++ b/time.c
+@@ -326,6 +326,8 @@ summarize (fp, fmt, command, resp)
+ {
+   unsigned long r;		/* Elapsed real milliseconds.  */
+   unsigned long v;		/* Elapsed virtual (CPU) milliseconds.  */
++  unsigned long ru;		/* Elapsed real microseconds.  */
++  unsigned long vu;		/* Elapsed virtual (CPU) microseconds.  */
+ 
+   if (verbose)
+   {
+@@ -350,6 +352,17 @@ summarize (fp, fmt, command, resp)
+   v = resp->ru.ru_utime.tv_sec * 1000 + resp->ru.ru_utime.TV_MSEC +
+     resp->ru.ru_stime.tv_sec * 1000 + resp->ru.ru_stime.TV_MSEC;
+ 
++  if (r == 0 && v == 0)
++    {
++      ru = resp->elapsed.tv_usec;
++      vu = resp->ru.ru_utime.TV_USEC + resp->ru.ru_stime.TV_USEC;
++    }
++  else
++    {
++      ru = 0;
++      vu = 0;
++    }
++
+   while (*fmt)
+     {
+       switch (*fmt)
+@@ -408,6 +421,8 @@ summarize (fp, fmt, command, resp)
+ 	      /* % cpu is (total cpu time)/(elapsed time).  */
+ 	      if (r > 0)
+ 		fprintf (fp, "%lu%%", (v * 100 / r));
++	      else if (ru > 0)
++		fprintf (fp, "%lu%%", (vu * 100 / ru));
+ 	      else
+ 		fprintf (fp, "?%%");
+ 	      break;
+-- 
+1.7.4.4
+

Deleted: extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
===================================================================
--- extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch	2012-01-25 01:42:41 UTC (rev 147241)
+++ extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch	2012-01-25 01:42:55 UTC (rev 147242)
@@ -1,32 +0,0 @@
-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
-

Copied: time/repos/extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch (from rev 147241, time/trunk/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch)
===================================================================
--- extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch	                        (rev 0)
+++ extra-i686/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch	2012-01-25 01:42:55 UTC (rev 147242)
@@ -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
+

Deleted: extra-i686/time.install
===================================================================
--- extra-i686/time.install	2012-01-25 01:42:41 UTC (rev 147241)
+++ extra-i686/time.install	2012-01-25 01:42:55 UTC (rev 147242)
@@ -1,20 +0,0 @@
-infodir=/usr/share/info
-filelist=(time.info.gz)
-
-post_install() {
-  [ -x usr/bin/install-info ] || return 0
-  for file in ${filelist[@]}; do
-    install-info $infodir/$file $infodir/dir 2> /dev/null
-  done
-}
-
-post_upgrade() {
-  post_install $1
-}
-
-pre_remove() {
-  [ -x usr/bin/install-info ] || return 0
-  for file in ${filelist[@]}; do
-    install-info --delete $infodir/$file $infodir/dir 2> /dev/null
-  done
-}

Copied: time/repos/extra-i686/time.install (from rev 147241, time/trunk/time.install)
===================================================================
--- extra-i686/time.install	                        (rev 0)
+++ extra-i686/time.install	2012-01-25 01:42:55 UTC (rev 147242)
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(time.info.gz)
+
+post_install() {
+  [ -x usr/bin/install-info ] || return 0
+  for file in ${filelist[@]}; do
+    install-info $infodir/$file $infodir/dir 2> /dev/null
+  done
+}
+
+post_upgrade() {
+  post_install $1
+}
+
+pre_remove() {
+  [ -x usr/bin/install-info ] || return 0
+  for file in ${filelist[@]}; do
+    install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+  done
+}

Deleted: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD	2012-01-25 01:42:41 UTC (rev 147241)
+++ extra-x86_64/PKGBUILD	2012-01-25 01:42:55 UTC (rev 147242)
@@ -1,40 +0,0 @@
-# $Id$
-# Maintainer: Stéphane Gaudreault <stephane at archlinux.us>
-# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
-# Contributor: damir <damir at archlinux.org>
-
-pkgname=time
-pkgver=1.7
-pkgrel=5
-pkgdesc="Utility for monitoring a program's use of system resources"
-arch=('i686' 'x86_64')
-url="http://www.gnu.org/directory/time.html"
-license=('GPL')
-depends=('glibc')
-install=time.install
-source=(http://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz
-        time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
-        time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch)
-sha1sums=('dde0c28c7426960736933f3e763320680356cc6a'
-          'fff80e05dd41f0a59bb1f49d1c6e581d5e8e92e5'
-          'b2a909e1d92f7af1bc99a4524ad84d467ed79a06')
-
-
-build() {
-	cd "${srcdir}/${pkgname}-${pkgver}"
-   
-   # cf https://bugzilla.redhat.com/show_bug.cgi?id=527276
-   patch -Np1 -i ../time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
-
-   # cf https://bugzilla.redhat.com/show_bug.cgi?id=702826
-   patch -Np1 -i ../time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
-
-	./configure --prefix=/usr --infodir=/usr/share/info
-	make
-}
-
-package() {
-	cd "${srcdir}/${pkgname}-${pkgver}"
-
-	make exec_prefix="${pkgdir}/usr" infodir="${pkgdir}/usr/share/info" install
-}

Copied: time/repos/extra-x86_64/PKGBUILD (from rev 147241, time/trunk/PKGBUILD)
===================================================================
--- extra-x86_64/PKGBUILD	                        (rev 0)
+++ extra-x86_64/PKGBUILD	2012-01-25 01:42:55 UTC (rev 147242)
@@ -0,0 +1,40 @@
+# $Id$
+# Maintainer: Stéphane Gaudreault <stephane at archlinux.us>
+# Contributor: Daniel J Griffiths <ghost1227 at archlinux.us>
+# Contributor: damir <damir at archlinux.org>
+
+pkgname=time
+pkgver=1.7
+pkgrel=6
+pkgdesc="Utility for monitoring a program's use of system resources"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/directory/time.html"
+license=('GPL')
+depends=('glibc')
+install=time.install
+source=(http://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz
+        time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
+        time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch)
+sha1sums=('dde0c28c7426960736933f3e763320680356cc6a'
+          'fff80e05dd41f0a59bb1f49d1c6e581d5e8e92e5'
+          'b2a909e1d92f7af1bc99a4524ad84d467ed79a06')
+
+
+build() {
+	cd "${srcdir}/${pkgname}-${pkgver}"
+   
+   # cf https://bugzilla.redhat.com/show_bug.cgi?id=527276
+   patch -Np1 -i ../time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
+
+   # cf https://bugzilla.redhat.com/show_bug.cgi?id=702826
+   patch -Np1 -i ../time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
+
+	./configure --prefix=/usr --infodir=/usr/share/info
+	make
+}
+
+package() {
+	cd "${srcdir}/${pkgname}-${pkgver}"
+
+	make exec_prefix="${pkgdir}/usr" infodir="${pkgdir}/usr/share/info" install
+}

Deleted: extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch
===================================================================
--- extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch	2012-01-25 01:42:41 UTC (rev 147241)
+++ extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch	2012-01-25 01:42:55 UTC (rev 147242)
@@ -1,72 +0,0 @@
-From 0d743a7d946fe176a07baf2586a6af0e867fd89c Mon Sep 17 00:00:00 2001
-From: H.J. Lu <hongjiu.lu at intel.com>
-Date: Wed, 11 May 2011 16:19:55 +0200
-Subject: [PATCH] Recompute CPU usage at microsecond level
-
-If job finishes quickly, miliseconds arithmetic rounds to zero. If
-that happens, recalculate CPU usage ratio with microsecond accuracy
-to raise chance to get non-zero values.
----
- resuse.h |    2 ++
- time.c   |   15 +++++++++++++++
- 2 files changed, 17 insertions(+), 0 deletions(-)
-
-diff --git a/resuse.h b/resuse.h
-index 992143f..7a3ee66 100644
---- a/resuse.h
-+++ b/resuse.h
-@@ -33,9 +33,11 @@ struct timeval
- #if HAVE_SYS_RUSAGE_H
- /* This rusage structure measures nanoseconds instead of microseconds.  */
- # define TV_MSEC tv_nsec / 1000000
-+# define TV_USEC tv_nsec / 1000
- # include <sys/rusage.h>
- #else
- # define TV_MSEC tv_usec / 1000
-+# define TV_USEC tv_usec
- # if HAVE_WAIT3
- #  include <sys/resource.h>
- # else
-diff --git a/time.c b/time.c
-index 43aec0b..96cfdde 100644
---- a/time.c
-+++ b/time.c
-@@ -326,6 +326,8 @@ summarize (fp, fmt, command, resp)
- {
-   unsigned long r;		/* Elapsed real milliseconds.  */
-   unsigned long v;		/* Elapsed virtual (CPU) milliseconds.  */
-+  unsigned long ru;		/* Elapsed real microseconds.  */
-+  unsigned long vu;		/* Elapsed virtual (CPU) microseconds.  */
- 
-   if (verbose)
-   {
-@@ -350,6 +352,17 @@ summarize (fp, fmt, command, resp)
-   v = resp->ru.ru_utime.tv_sec * 1000 + resp->ru.ru_utime.TV_MSEC +
-     resp->ru.ru_stime.tv_sec * 1000 + resp->ru.ru_stime.TV_MSEC;
- 
-+  if (r == 0 && v == 0)
-+    {
-+      ru = resp->elapsed.tv_usec;
-+      vu = resp->ru.ru_utime.TV_USEC + resp->ru.ru_stime.TV_USEC;
-+    }
-+  else
-+    {
-+      ru = 0;
-+      vu = 0;
-+    }
-+
-   while (*fmt)
-     {
-       switch (*fmt)
-@@ -408,6 +421,8 @@ summarize (fp, fmt, command, resp)
- 	      /* % cpu is (total cpu time)/(elapsed time).  */
- 	      if (r > 0)
- 		fprintf (fp, "%lu%%", (v * 100 / r));
-+	      else if (ru > 0)
-+		fprintf (fp, "%lu%%", (vu * 100 / ru));
- 	      else
- 		fprintf (fp, "?%%");
- 	      break;
--- 
-1.7.4.4
-

Copied: time/repos/extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch (from rev 147241, time/trunk/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch)
===================================================================
--- extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch	                        (rev 0)
+++ extra-x86_64/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch	2012-01-25 01:42:55 UTC (rev 147242)
@@ -0,0 +1,72 @@
+From 0d743a7d946fe176a07baf2586a6af0e867fd89c Mon Sep 17 00:00:00 2001
+From: H.J. Lu <hongjiu.lu at intel.com>
+Date: Wed, 11 May 2011 16:19:55 +0200
+Subject: [PATCH] Recompute CPU usage at microsecond level
+
+If job finishes quickly, miliseconds arithmetic rounds to zero. If
+that happens, recalculate CPU usage ratio with microsecond accuracy
+to raise chance to get non-zero values.
+---
+ resuse.h |    2 ++
+ time.c   |   15 +++++++++++++++
+ 2 files changed, 17 insertions(+), 0 deletions(-)
+
+diff --git a/resuse.h b/resuse.h
+index 992143f..7a3ee66 100644
+--- a/resuse.h
++++ b/resuse.h
+@@ -33,9 +33,11 @@ struct timeval
+ #if HAVE_SYS_RUSAGE_H
+ /* This rusage structure measures nanoseconds instead of microseconds.  */
+ # define TV_MSEC tv_nsec / 1000000
++# define TV_USEC tv_nsec / 1000
+ # include <sys/rusage.h>
+ #else
+ # define TV_MSEC tv_usec / 1000
++# define TV_USEC tv_usec
+ # if HAVE_WAIT3
+ #  include <sys/resource.h>
+ # else
+diff --git a/time.c b/time.c
+index 43aec0b..96cfdde 100644
+--- a/time.c
++++ b/time.c
+@@ -326,6 +326,8 @@ summarize (fp, fmt, command, resp)
+ {
+   unsigned long r;		/* Elapsed real milliseconds.  */
+   unsigned long v;		/* Elapsed virtual (CPU) milliseconds.  */
++  unsigned long ru;		/* Elapsed real microseconds.  */
++  unsigned long vu;		/* Elapsed virtual (CPU) microseconds.  */
+ 
+   if (verbose)
+   {
+@@ -350,6 +352,17 @@ summarize (fp, fmt, command, resp)
+   v = resp->ru.ru_utime.tv_sec * 1000 + resp->ru.ru_utime.TV_MSEC +
+     resp->ru.ru_stime.tv_sec * 1000 + resp->ru.ru_stime.TV_MSEC;
+ 
++  if (r == 0 && v == 0)
++    {
++      ru = resp->elapsed.tv_usec;
++      vu = resp->ru.ru_utime.TV_USEC + resp->ru.ru_stime.TV_USEC;
++    }
++  else
++    {
++      ru = 0;
++      vu = 0;
++    }
++
+   while (*fmt)
+     {
+       switch (*fmt)
+@@ -408,6 +421,8 @@ summarize (fp, fmt, command, resp)
+ 	      /* % cpu is (total cpu time)/(elapsed time).  */
+ 	      if (r > 0)
+ 		fprintf (fp, "%lu%%", (v * 100 / r));
++	      else if (ru > 0)
++		fprintf (fp, "%lu%%", (vu * 100 / ru));
+ 	      else
+ 		fprintf (fp, "?%%");
+ 	      break;
+-- 
+1.7.4.4
+

Deleted: extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch
===================================================================
--- extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch	2012-01-25 01:42:41 UTC (rev 147241)
+++ extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch	2012-01-25 01:42:55 UTC (rev 147242)
@@ -1,32 +0,0 @@
-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
-

Copied: time/repos/extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch (from rev 147241, time/trunk/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch)
===================================================================
--- extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch	                        (rev 0)
+++ extra-x86_64/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch	2012-01-25 01:42:55 UTC (rev 147242)
@@ -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
+

Deleted: extra-x86_64/time.install
===================================================================
--- extra-x86_64/time.install	2012-01-25 01:42:41 UTC (rev 147241)
+++ extra-x86_64/time.install	2012-01-25 01:42:55 UTC (rev 147242)
@@ -1,20 +0,0 @@
-infodir=/usr/share/info
-filelist=(time.info.gz)
-
-post_install() {
-  [ -x usr/bin/install-info ] || return 0
-  for file in ${filelist[@]}; do
-    install-info $infodir/$file $infodir/dir 2> /dev/null
-  done
-}
-
-post_upgrade() {
-  post_install $1
-}
-
-pre_remove() {
-  [ -x usr/bin/install-info ] || return 0
-  for file in ${filelist[@]}; do
-    install-info --delete $infodir/$file $infodir/dir 2> /dev/null
-  done
-}

Copied: time/repos/extra-x86_64/time.install (from rev 147241, time/trunk/time.install)
===================================================================
--- extra-x86_64/time.install	                        (rev 0)
+++ extra-x86_64/time.install	2012-01-25 01:42:55 UTC (rev 147242)
@@ -0,0 +1,20 @@
+infodir=/usr/share/info
+filelist=(time.info.gz)
+
+post_install() {
+  [ -x usr/bin/install-info ] || return 0
+  for file in ${filelist[@]}; do
+    install-info $infodir/$file $infodir/dir 2> /dev/null
+  done
+}
+
+post_upgrade() {
+  post_install $1
+}
+
+pre_remove() {
+  [ -x usr/bin/install-info ] || return 0
+  for file in ${filelist[@]}; do
+    install-info --delete $infodir/$file $infodir/dir 2> /dev/null
+  done
+}




More information about the arch-commits mailing list