This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.10-377-g67854c1


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  67854c131c2ba8c013debf466b20cb13fffa120b (commit)
      from  e0f471a1187cdfcb029c80819da52b4c12e352f5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=67854c131c2ba8c013debf466b20cb13fffa120b

commit 67854c131c2ba8c013debf466b20cb13fffa120b
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu Oct 29 14:19:33 2009 -0700

    Fix repairing of memusage trace files.

diff --git a/ChangeLog b/ChangeLog
index b673fd9..48dfde7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-10-29  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #10717]
+	* malloc/memusagestat.c (main): Fix repairing of trace files.  We also
+	have to compute maxsize_total, we have to update the variables, and
+	the also_total handling must happen after the repair.
+
 	[BZ #10742]
 	* nscd/dbg_log.c (dbg_log): Print timestamp before the message text.
 	Based on patch by Jeffrey Bastian <jbastian@redhat.com>.
diff --git a/malloc/memusagestat.c b/malloc/memusagestat.c
index bf33175..4d57f2c 100644
--- a/malloc/memusagestat.c
+++ b/malloc/memusagestat.c
@@ -191,13 +191,6 @@ main (int argc, char *argv[])
   maxsize_heap = headent[1].heap;
   maxsize_stack = headent[1].stack;
   maxsize_total = headent[0].stack;
-  if (also_total)
-    {
-      /* We use one scale and since we also draw the total amount of
-	 memory used we have to adapt the maximum.  */
-      maxsize_heap = maxsize_total;
-      maxsize_stack = maxsize_total;
-    }
 
   if (maxsize_heap == 0 && maxsize_stack == 0)
     {
@@ -210,18 +203,31 @@ main (int argc, char *argv[])
 	{
 	  if (read (fd, &next, sizeof (next)) == 0)
 	    break;
-	  if (next.heap > headent[1].heap)
-	    headent[1].heap = next.heap;
-	  if (next.stack > headent[1].stack)
-	    headent[1].stack = next.stack;
+	  if (next.heap > maxsize_heap)
+	    maxsize_heap = next.heap;
+	  if (next.stack > maxsize_stack)
+	    maxsize_stack = next.stack;
+	  if (maxsize_heap + maxsize_stack > maxsize_total)
+	    maxsize_total = maxsize_heap + maxsize_stack;
 	}
 
+      headent[0].stack = maxsize_total;
+      headent[1].heap = maxsize_heap;
+      headent[1].stack = maxsize_stack;
       headent[1].time_low = next.time_low;
       headent[1].time_high = next.time_high;
 
       /* Write the computed values in the file.  */
-      lseek (fd, sizeof (struct entry), SEEK_SET);
-      write (fd, &headent[1], sizeof (struct entry));
+      lseek (fd, 0, SEEK_SET);
+      write (fd, headent, 2 * sizeof (struct entry));
+    }
+
+  if (also_total)
+    {
+      /* We use one scale and since we also draw the total amount of
+	 memory used we have to adapt the maximum.  */
+      maxsize_heap = maxsize_total;
+      maxsize_stack = maxsize_total;
     }
 
   start_time = ((uint64_t) headent[0].time_high) << 32 | headent[0].time_low;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    5 +++++
 malloc/memusagestat.c |   32 +++++++++++++++++++-------------
 2 files changed, 24 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]