[pypy-commit] stmgc timelog: intermediate checkin

arigo noreply at buildbot.pypy.org
Mon Mar 31 09:33:34 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: timelog
Changeset: r1124:bd8dd6760887
Date: 2014-03-31 08:44 +0200
http://bitbucket.org/pypy/stmgc/changeset/bd8dd6760887/

Log:	intermediate checkin

diff --git a/c7/stm/core.h b/c7/stm/core.h
--- a/c7/stm/core.h
+++ b/c7/stm/core.h
@@ -155,6 +155,9 @@
     struct stm_shadowentry_s *shadowstack_at_start_of_transaction;
     object_t *threadlocal_at_start_of_transaction;
 
+    /* Time logging */
+    stm_timelog_t *tlog;
+
     /* For debugging */
 #ifndef NDEBUG
     pthread_t running_pthread;
diff --git a/c7/stmgc.h b/c7/stmgc.h
--- a/c7/stmgc.h
+++ b/c7/stmgc.h
@@ -340,16 +340,16 @@
 /* ---------- timelogs ---------- */
 
 enum {
-    STLOG_REASON_UNKNOWN,
-    STLOG_REASON_ABORT_SELF,
-    STLOG_REASON_ABORT_OTHER,
-    STLOG_REASON_PAUSE,
+    STM_LOG_REASON_UNKNOWN,
+    STM_LOG_REASON_ABORT_SELF,
+    STM_LOG_REASON_ABORT_OTHER,
+    STM_LOG_REASON_PAUSE,
 };
 enum {
-    STLOG_CONTENTION_NONE,
-    STLOG_CONTENTION_WRITE_WRITE,
-    STLOG_CONTENTION_WRITE_READ,
-    STLOG_CONTENTION_INEVITABLE,
+    STM_LOG_CONTENTION_NONE,
+    STM_LOG_CONTENTION_WRITE_WRITE,
+    STM_LOG_CONTENTION_WRITE_READ,
+    STM_LOG_CONTENTION_INEVITABLE,
 };
 
 typedef struct stm_timelog_s {
diff --git a/c7/test/support.py b/c7/test/support.py
--- a/c7/test/support.py
+++ b/c7/test/support.py
@@ -99,14 +99,14 @@
 int stm_can_move(object_t *);
 void stm_call_on_abort(stm_thread_local_t *, void *key, void callback(void *));
 
-#define STLOG_REASON_UNKNOWN ...
-#define STLOG_REASON_ABORT_SELF ...
-#define STLOG_REASON_ABORT_OTHER ...
-#define STLOG_REASON_PAUSE ...
-#define STLOG_CONTENTION_NONE ...
-#define STLOG_CONTENTION_WRITE_WRITE ...
-#define STLOG_CONTENTION_WRITE_READ ...
-#define STLOG_CONTENTION_INEVITABLE ...
+#define STM_LOG_REASON_UNKNOWN ...
+#define STM_LOG_REASON_ABORT_SELF ...
+#define STM_LOG_REASON_ABORT_OTHER ...
+#define STM_LOG_REASON_PAUSE ...
+#define STM_LOG_CONTENTION_NONE ...
+#define STM_LOG_CONTENTION_WRITE_WRITE ...
+#define STM_LOG_CONTENTION_WRITE_READ ...
+#define STM_LOG_CONTENTION_INEVITABLE ...
 
 typedef struct {
     uint8_t reason;
diff --git a/c7/test/test_timelog.py b/c7/test/test_timelog.py
--- a/c7/test/test_timelog.py
+++ b/c7/test/test_timelog.py
@@ -19,8 +19,8 @@
         self.start_transaction()
         tlog = self.fetch_and_remove_timelog()
         assert tlog != ffi.NULL
-        assert tlog.reason == lib.STLOG_REASON_UNKNOWN
-        assert tlog.contention == lib.STLOG_CONTENTION_NONE
+        assert tlog.reason == lib.STM_LOG_REASON_UNKNOWN
+        assert tlog.contention == lib.STM_LOG_CONTENTION_NONE
         assert tlog.user == 0
         assert 0.0499 <= tlog.time_lost < 1.0
         lib.stm_free_timelog(tlog)


More information about the pypy-commit mailing list