[pypy-commit] stmgc instrumented: some more data

Raemi noreply at buildbot.pypy.org
Thu Jun 19 10:56:53 CEST 2014


Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch: instrumented
Changeset: r1250:c26593f884a3
Date: 2014-05-28 09:16 +0200
http://bitbucket.org/pypy/stmgc/changeset/c26593f884a3/

Log:	some more data

diff --git a/c7/stm/setup.c b/c7/stm/setup.c
--- a/c7/stm/setup.c
+++ b/c7/stm/setup.c
@@ -94,8 +94,35 @@
 #ifdef MEASURE_MEM
         struct rusage usage;
         getrusage(RUSAGE_SELF, &usage);
-        fprintf(stderr, "{%f:%ld/%ld}\n", time,
-                (long)pages_ctl.total_allocated, usage.ru_maxrss*1024);
+
+        uintptr_t pagenum, endpagenum,
+            total_used_pages = 0, total_privatized_pages = 0;
+        pagenum = END_NURSERY_PAGE;   /* starts after the nursery */
+        endpagenum = (uninitialized_page_start - stm_object_pages) / 4096UL;
+        while (1) {
+            if (UNLIKELY(pagenum == endpagenum)) {
+                /* we reach this point usually twice, because there are
+                   more pages after 'uninitialized_page_stop' */
+                if (endpagenum == NB_PAGES)
+                    break;   /* done */
+                pagenum = (uninitialized_page_stop - stm_object_pages) / 4096UL;
+                endpagenum = NB_PAGES;
+                continue;
+            }
+
+            total_used_pages++;
+            long i;
+            for (i = 1; i <= NB_SEGMENTS; i++) {
+                if (is_private_page(i, pagenum)) {
+                    total_privatized_pages++;
+                }
+            }
+            pagenum++;
+        }
+
+        fprintf(stderr, "{%f:%ld/%ld/%f}\n", time,
+                (long)pages_ctl.total_allocated, usage.ru_maxrss*1024,
+                (float)total_privatized_pages / total_used_pages);
 #endif
     }
     return NULL;


More information about the pypy-commit mailing list