[pypy-commit] stmgc c8-marker: in-progress

arigo noreply at buildbot.pypy.org
Sun Mar 8 18:42:34 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: c8-marker
Changeset: r1696:7d44874ec01b
Date: 2015-03-08 18:43 +0100
http://bitbucket.org/pypy/stmgc/changeset/7d44874ec01b/

Log:	in-progress

diff --git a/c8/stm/core.c b/c8/stm/core.c
--- a/c8/stm/core.c
+++ b/c8/stm/core.c
@@ -49,6 +49,8 @@
 
     DEBUG_EXPECT_SEGFAULT(false);
     for (; undo < end; undo++) {
+        if (undo->type == TYPE_POSITION_MARKER)
+            continue;
         object_t *obj = undo->object;
         stm_char *oslice = ((stm_char *)obj) + SLICE_OFFSET(undo->slice);
         uintptr_t current_page_num = ((uintptr_t)oslice) / 4096;
@@ -269,6 +271,11 @@
         struct stm_undo_s *undo = cl->written;
         struct stm_undo_s *end = undo + cl->written_count;
         for (; undo < end; undo++) {
+            if (undo->type == TYPE_POSITION_MARKER) {
+                fprintf(stderr, "    marker %p %lu\n",
+                        undo->marker_object, undo->marker_odd_number);
+                continue;
+            }
             fprintf(stderr, "    obj %p, size %d, ofs %lu: ", undo->object,
                     SLICE_SIZE(undo->slice), SLICE_OFFSET(undo->slice));
             /* long i; */
@@ -369,6 +376,7 @@
                                the old (but unmodified) version to the newer version.
                             */
                             reset_modified_from_backup_copies(my_segnum);
+                            timing_write_read_contention(cl->written, undo);
                             needs_abort = true;
 
                             dprintf(("_stm_validate() failed for obj %p\n", undo->object));
@@ -528,7 +536,6 @@
         STM_PSEGMENT->safe_point = SP_NO_TRANSACTION;
 
         list_clear(STM_PSEGMENT->modified_old_objects);
-        list_clear(STM_PSEGMENT->modified_old_objects_markers);
         STM_PSEGMENT->last_commit_log_entry = new;
         release_modification_lock(STM_SEGMENT->segment_num);
     }
@@ -558,7 +565,6 @@
         STM_PSEGMENT->transaction_state = TS_NONE;
         STM_PSEGMENT->safe_point = SP_NO_TRANSACTION;
         list_clear(STM_PSEGMENT->modified_old_objects);
-        list_clear(STM_PSEGMENT->modified_old_objects_markers);
         STM_PSEGMENT->last_commit_log_entry = new;
 
         /* do it: */
@@ -601,6 +607,8 @@
 {
     dprintf(("make_bk_slices_for_range(%p, %lu, %lu)\n",
              obj, start - (stm_char*)obj, end - start));
+    timing_record_write_position();
+
     char *realobj = REAL_ADDRESS(STM_SEGMENT->segment_base, obj);
     uintptr_t first_page = ((uintptr_t)start) / 4096UL;
     uintptr_t end_page = ((uintptr_t)end) / 4096UL;
@@ -632,7 +640,6 @@
             (uintptr_t)obj,     /* obj */
             (uintptr_t)bk_slice,  /* bk_addr */
             NEW_SLICE(slice_off, slice_sz));
-        timing_record_write();
         dprintf(("> append slice %p, off=%lu, sz=%lu\n", bk_slice, slice_off, slice_sz));
         release_modification_lock(STM_SEGMENT->segment_num);
 
@@ -1075,7 +1082,6 @@
     }
 
     assert(list_is_empty(STM_PSEGMENT->modified_old_objects));
-    assert(list_is_empty(STM_PSEGMENT->modified_old_objects_markers));
     assert(list_is_empty(STM_PSEGMENT->large_overflow_objects));
     assert(list_is_empty(STM_PSEGMENT->objects_pointing_to_nursery));
     assert(list_is_empty(STM_PSEGMENT->young_weakrefs));
@@ -1087,7 +1093,7 @@
     assert(STM_PSEGMENT->finalizers == NULL);
 #ifndef NDEBUG
     /* this should not be used when objects_pointing_to_nursery == NULL */
-    STM_PSEGMENT->modified_old_objects_markers_num_old = 99999999999999999L;
+    STM_PSEGMENT->position_markers_len_old = 99999999999999999L;
 #endif
 
     check_nursery_at_transaction_start();
@@ -1270,6 +1276,8 @@
     struct stm_undo_s *end = (struct stm_undo_s *)(list->items + list->count);
 
     for (; undo < end; undo++) {
+        if (undo->type == TYPE_POSITION_MARKER)
+            continue;
         object_t *obj = undo->object;
         char *dst = REAL_ADDRESS(pseg->pub.segment_base, obj);
 
diff --git a/c8/stm/core.h b/c8/stm/core.h
--- a/c8/stm/core.h
+++ b/c8/stm/core.h
@@ -84,21 +84,18 @@
        track the STM status: these are old objects that where written
        to and that will need to be recorded in the commit log.  The
        list contains three entries for every such object, in the same
-       format as 'struct stm_undo_s' below.
+       format as 'struct stm_undo_s' below.  It can also represent a
+       position marker, like 'struct stm_undo_s'.
     */
     struct list_s *modified_old_objects;
+    uintptr_t position_markers_last;     /* index of most recent pos marker */
+    uintptr_t position_markers_len_old;  /* length of list at last minor col */
 
     struct list_s *objects_pointing_to_nursery;
     struct list_s *old_objects_with_cards_set;
     struct tree_s *young_outside_nursery;
     struct tree_s *nursery_objects_shadows;
 
-    /* For each entry in 'modified_old_objects', we have two entries
-       in the following list, which give the marker at the time we added
-       the entry to modified_old_objects. */
-    struct list_s *modified_old_objects_markers;
-    uintptr_t modified_old_objects_markers_num_old;
-
     /* List of all young weakrefs to check in minor collections. These
        are the only weakrefs that may point to young objects and never
        contain NULL. */
@@ -180,18 +177,27 @@
 
 /* Commit Log things */
 struct stm_undo_s {
-    object_t *object;   /* the object that is modified */
-    char *backup;       /* some backup data (a slice of the original obj) */
-    uint64_t slice;     /* location and size of this slice (cannot cross
-                           pages).  The size is in the lower 2 bytes, and
-                           the offset in the remaining 6 bytes. */
+  union {
+    struct {
+        object_t *object;   /* the object that is modified */
+        char *backup;       /* some backup data (a slice of the original obj) */
+        uint64_t slice;     /* location and size of this slice (cannot cross
+                               pages).  The size is in the lower 2 bytes, and
+                               the offset in the remaining 6 bytes. */
+    };
+    struct {
+        intptr_t type;               /* TYPE_POSITION_MARKER */
+        uintptr_t marker_odd_number; /* the odd number part of the marker */
+        object_t *marker_object;     /* the object part of the marker */
+    };
+  };
 };
+#define TYPE_POSITION_MARKER    (-1)
 #define SLICE_OFFSET(slice)  ((slice) >> 16)
 #define SLICE_SIZE(slice)    ((int)((slice) & 0xFFFF))
 #define NEW_SLICE(offset, size) (((uint64_t)(offset)) << 16 | (size))
 
 
-
 /* The model is: we have a global chained list, from 'commit_log_root',
    of 'struct stm_commit_log_entry_s' entries.  Every one is fully
    read-only apart from the 'next' field.  Every one stands for one
diff --git a/c8/stm/gcpage.c b/c8/stm/gcpage.c
--- a/c8/stm/gcpage.c
+++ b/c8/stm/gcpage.c
@@ -348,6 +348,8 @@
         struct stm_undo_s *modified = (struct stm_undo_s *)lst->items;
         struct stm_undo_s *end = (struct stm_undo_s *)(lst->items + lst->count);
         for (; modified < end; modified++) {
+            if (modified->type == TYPE_POSITION_MARKER)
+                continue;
             object_t *obj = modified->object;
             struct object_s *dst = (struct object_s*)REAL_ADDRESS(base, obj);
 
@@ -388,14 +390,16 @@
 
 static void mark_visit_from_markers(void)
 {
-    long j;
-    for (j = 1; j < NB_SEGMENTS; j++) {
-        struct stm_priv_segment_info_s *pseg = get_priv_segment(j);
-        struct list_s *lst = pseg->modified_old_objects_markers;
-        uintptr_t i;
-        for (i = list_count(lst); i > 0; i -= 2) {
-            mark_visit_possibly_new_object((object_t *)list_item(lst, i - 1),
-                                           pseg);
+    long i;
+    for (i = 1; i < NB_SEGMENTS; i++) {
+        struct stm_priv_segment_info_s *pseg = get_priv_segment(i);
+        struct list_s *lst = get_priv_segment(i)->modified_old_objects;
+
+        struct stm_undo_s *modified = (struct stm_undo_s *)lst->items;
+        struct stm_undo_s *end = (struct stm_undo_s *)(lst->items + lst->count);
+        for (; modified < end; modified++) {
+            if (modified->type == TYPE_POSITION_MARKER)
+                mark_visit_possibly_new_object(modified->marker_object, pseg);
         }
     }
 }
diff --git a/c8/stm/marker.c b/c8/stm/marker.c
--- a/c8/stm/marker.c
+++ b/c8/stm/marker.c
@@ -3,11 +3,10 @@
 #endif
 
 
-static void marker_fetch(stm_loc_marker_t *out_marker)
+static bool marker_fetch(stm_thread_local_t *tl, stm_loc_marker_t *out_marker)
 {
-    /* Fetch the current marker from the 'out_marker->tl's shadow stack,
+    /* Fetch the current marker from tl's shadow stack,
        and return it in 'out_marker->odd_number' and 'out_marker->object'. */
-    stm_thread_local_t *tl = out_marker->tl;
     struct stm_shadowentry_s *current = tl->shadowstack - 1;
     struct stm_shadowentry_s *base = tl->shadowstack_base;
 
@@ -23,68 +22,69 @@
         /* found the odd marker */
         out_marker->odd_number = (uintptr_t)current[0].ss;
         out_marker->object = current[1].ss;
+        return true;
     }
     else {
         /* no marker found */
-        out_marker->odd_number = 0;
-        out_marker->object = NULL;
+        return false;
     }
 }
 
-static void marker_fetch_obj_write(object_t *obj, stm_loc_marker_t *out_marker)
+static void marker_fetch_obj_write(struct stm_undo_s *start,
+                                   struct stm_undo_s *contention,
+                                   stm_loc_marker_t *out_marker)
 {
-    /* From 'out_marker->tl', fill in 'out_marker->segment_base' and
-       'out_marker->odd_number' and 'out_marker->object' from the
-       marker associated with writing the 'obj'.
+    /* Fill out 'out_marker->odd_number' and 'out_marker->object' from
+       the marker just before 'contention' in the list starting at
+       'start'.
     */
-    assert(_has_mutex());
-
-    long i, num;
-    int in_segment_num = out_marker->tl->associated_segment_num;
-    assert(in_segment_num >= 1);
-    struct stm_priv_segment_info_s *pseg = get_priv_segment(in_segment_num);
-    struct list_s *mlst = pseg->modified_old_objects;
-    struct list_s *mlstm = pseg->modified_old_objects_markers;
-    num = list_count(mlstm) / 2;
-    assert(num * 3 <= list_count(mlst));
-    for (i = 0; i < num; i++) {
-        if (list_item(mlst, i * 3) == (uintptr_t)obj) {
-            out_marker->odd_number = list_item(mlstm, i * 2 + 0);
-            out_marker->object = (object_t *)list_item(mlstm, i * 2 + 1);
+    while (contention != start) {
+        --contention;
+        if (contention->type == TYPE_POSITION_MARKER) {
+            out_marker->odd_number = contention->marker_odd_number;
+            out_marker->object = contention->marker_object;
             return;
         }
     }
+    /* no position marker found... */
     out_marker->odd_number = 0;
     out_marker->object = NULL;
 }
 
-static void _timing_record_write(void)
+static void _timing_record_write_position(void)
 {
     stm_loc_marker_t marker;
-    marker.tl = STM_SEGMENT->running_thread;
-    marker_fetch(&marker);
+    if (!marker_fetch(STM_SEGMENT->running_thread, &marker))
+        return;
 
-    long base_count = list_count(STM_PSEGMENT->modified_old_objects) / 3;
-    struct list_s *mlstm = STM_PSEGMENT->modified_old_objects_markers;
-    while (list_count(mlstm) < 2 * base_count) {
-        mlstm = list_append2(mlstm, 0, 0);
+    struct list_s *list = STM_PSEGMENT->modified_old_objects;
+    uintptr_t i = STM_PSEGMENT->position_markers_last;
+    if (i < list_count(list)) {
+        struct stm_undo_s *undo = (struct stm_undo_s *)(list->items + i);
+        if (undo->type == TYPE_POSITION_MARKER &&
+            undo->marker_odd_number == marker.odd_number &&
+            undo->marker_object == marker.object)
+            return;    /* already up-to-date */
     }
-    mlstm = list_append2(mlstm, marker.odd_number, (uintptr_t)marker.object);
-    STM_PSEGMENT->modified_old_objects_markers = mlstm;
+
+    STM_PSEGMENT->position_markers_last = list_count(list);
+    STM_PSEGMENT->modified_old_objects = list_append3(
+        list,
+        TYPE_POSITION_MARKER,         /* type */
+        marker.odd_number,            /* marker_odd_number */
+        (uintptr_t)marker.object);    /* marker_object */
 }
 
-static void timing_write_read_contention(object_t *obj)
+static void timing_write_read_contention(struct stm_undo_s *start,
+                                         struct stm_undo_s *contention)
 {
     if (stmcb_timing_event == NULL)
         return;
 
-    /* Collect the older location of the write from the current thread. */
     stm_loc_marker_t marker;
-    marker.tl = STM_SEGMENT->running_thread;
-    marker.segment_base = STM_SEGMENT->segment_base;
-    marker_fetch_obj_write(obj, &marker);
-
-    stmcb_timing_event(marker.tl, STM_CONTENTION_WRITE_READ, &marker);
+    marker_fetch_obj_write(start, contention, &marker);
+    stmcb_timing_event(STM_SEGMENT->running_thread,
+                       STM_CONTENTION_WRITE_READ, &marker);
 }
 
 
diff --git a/c8/stm/marker.h b/c8/stm/marker.h
--- a/c8/stm/marker.h
+++ b/c8/stm/marker.h
@@ -1,10 +1,11 @@
 
-static void _timing_record_write(void);
-static void timing_write_read_contention(object_t *obj);
+static void _timing_record_write_position(void);
+static void timing_write_read_contention(struct stm_undo_s *start,
+                                         struct stm_undo_s *contention);
 
 
 #define timing_event(tl, event)                                         \
     (stmcb_timing_event != NULL ? stmcb_timing_event(tl, event, NULL) : (void)0)
 
-#define timing_record_write()                                           \
-    (stmcb_timing_event != NULL ? _timing_record_write() : (void)0)
+#define timing_record_write_position()                                  \
+    (stmcb_timing_event != NULL ? _timing_record_write_position() : (void)0)
diff --git a/c8/stm/nursery.c b/c8/stm/nursery.c
--- a/c8/stm/nursery.c
+++ b/c8/stm/nursery.c
@@ -410,16 +410,18 @@
     }
 }
 
-static void collect_roots_from_markers(uintptr_t num_old)
+static void collect_roots_from_markers(uintptr_t len_old)
 {
     dprintf(("collect_roots_from_markers\n"));
+
     /* visit the marker objects */
-    struct list_s *mlst = STM_PSEGMENT->modified_old_objects_markers;
-    STM_PSEGMENT->modified_old_objects_markers_num_old = list_count(mlst);
-    uintptr_t i, total = list_count(mlst);
-    assert((total & 1) == 0);
-    for (i = num_old + 1; i < total; i += 2) {
-        minor_trace_if_young((object_t **)list_ptr_to_item(mlst, i));
+    struct list_s *list = STM_PSEGMENT->modified_old_objects;
+    struct stm_undo_s *undo = (struct stm_undo_s *)(list->items + len_old);
+    struct stm_undo_s *end = (struct stm_undo_s *)(list->items + list->count);
+
+    for (; undo < end; undo++) {
+        if (undo->type == TYPE_POSITION_MARKER)
+            minor_trace_if_young(&undo->marker_object);
     }
 }
 
@@ -507,21 +509,23 @@
 
     STM_PSEGMENT->minor_collect_will_commit_now = commit;
 
-    uintptr_t num_old;
+    uintptr_t len_old;
     if (STM_PSEGMENT->overflow_number_has_been_used)
-        num_old = STM_PSEGMENT->modified_old_objects_markers_num_old;
+        len_old = STM_PSEGMENT->position_markers_len_old;
     else
-        num_old = 0;
+        len_old = 0;
 
     if (!commit) {
         /* 'STM_PSEGMENT->overflow_number' is used now by this collection,
            in the sense that it's copied to the overflow objects */
         STM_PSEGMENT->overflow_number_has_been_used = true;
+        STM_PSEGMENT->position_markers_len_old =
+            list_count(STM_PSEGMENT->modified_old_objects);
     }
 
     collect_cardrefs_to_nursery();
 
-    collect_roots_from_markers(num_old);
+    collect_roots_from_markers(len_old);
 
     collect_roots_in_nursery();
 
diff --git a/c8/stm/prof.c b/c8/stm/prof.c
new file mode 100644
--- /dev/null
+++ b/c8/stm/prof.c
@@ -0,0 +1,122 @@
+#include <stdio.h>
+#include <time.h>
+
+
+static FILE *profiling_file;
+static char *profiling_basefn = NULL;
+static stm_expand_marker_fn profiling_expand_marker;
+
+#define MARKER_LEN_MAX   160
+
+
+static bool close_timing_log(void);   /* forward */
+
+static void _stm_profiling_event(stm_thread_local_t *tl,
+                                 enum stm_event_e event,
+                                 stm_loc_marker_t *marker)
+{
+    struct buf_s {
+        uint32_t tv_sec;
+        uint32_t tv_nsec;
+        uint32_t thread_num;
+        uint8_t event;
+        uint8_t marker_length;
+        char extra[MARKER_LEN_MAX+1];
+    } __attribute__((packed));
+
+    struct buf_s buf;
+    struct timespec t;
+    clock_gettime(CLOCK_MONOTONIC, &t);
+    buf.tv_sec = t.tv_sec;
+    buf.tv_nsec = t.tv_nsec;
+    buf.thread_num = tl->thread_local_counter;
+    buf.event = event;
+    buf.marker_length = 0;
+
+    if (marker != NULL && marker->odd_number != 0) {
+        buf.marker_length = profiling_expand_marker(get_segment_base(0),
+                                                    marker,
+                                                    buf.extra, MARKER_LEN_MAX);
+    }
+
+    if (fwrite(&buf, offsetof(struct buf_s, extra) + buf.marker_length,
+               1, profiling_file) != 1) {
+        fprintf(stderr, "stmgc: profiling log file closed unexpectedly: %m\n");
+        close_timing_log();
+    }
+}
+
+static int default_expand_marker(stm_loc_marker_t *m, char *p, int s)
+{
+    *(uintptr_t *)p = m->odd_number;
+    return sizeof(uintptr_t);
+}
+
+static bool open_timing_log(const char *filename)
+{
+    profiling_file = fopen(filename, "w");
+    if (profiling_file == NULL)
+        return false;
+
+    fwrite("STMGC-C7-PROF01\n", 16, 1, profiling_file);
+    stmcb_timing_event = _stm_profiling_event;
+    return true;
+}
+
+static bool close_timing_log(void)
+{
+    if (stmcb_timing_event == &_stm_profiling_event) {
+        stmcb_timing_event = NULL;
+        fclose(profiling_file);
+        profiling_file = NULL;
+        return true;
+    }
+    return false;
+}
+
+static void prof_forksupport_prepare(void)
+{
+    if (profiling_file != NULL)
+        fflush(profiling_file);
+}
+
+static void prof_forksupport_child(void)
+{
+    if (close_timing_log() && profiling_basefn != NULL) {
+        char filename[1024];
+        snprintf(filename, sizeof(filename),
+                 "%s.fork%ld", profiling_basefn, (long)getpid());
+        open_timing_log(filename);
+    }
+}
+
+int stm_set_timing_log(const char *profiling_file_name, int fork_mode,
+                       stm_expand_marker_fn expand_marker)
+{
+    close_timing_log();
+    free(profiling_basefn);
+    profiling_basefn = NULL;
+
+    if (profiling_file_name == NULL)
+        return 0;
+
+    if (!expand_marker)
+        expand_marker = default_expand_marker;
+    profiling_expand_marker = expand_marker;
+
+    static bool fork_support_ready = false;
+    if (!fork_support_ready) {
+        int res = pthread_atfork(prof_forksupport_prepare,
+                                 NULL, prof_forksupport_child);
+        if (res != 0)
+            stm_fatalerror("pthread_atfork() failed: %m");
+        fork_support_ready = true;
+    }
+
+    if (!open_timing_log(profiling_file_name))
+        return -1;
+
+    if (fork_mode != 0)
+        profiling_basefn = strdup(profiling_file_name);
+    return 0;
+}
diff --git a/c8/stm/setup.c b/c8/stm/setup.c
--- a/c8/stm/setup.c
+++ b/c8/stm/setup.c
@@ -100,7 +100,6 @@
         pr->pub.segment_num = i;
         pr->pub.segment_base = segment_base;
         pr->modified_old_objects = list_create();
-        pr->modified_old_objects_markers = list_create();
         pr->large_overflow_objects = list_create();
         pr->young_weakrefs = list_create();
         pr->old_weakrefs = list_create();
@@ -153,7 +152,6 @@
         list_free(pr->objects_pointing_to_nursery);
         list_free(pr->old_objects_with_cards_set);
         list_free(pr->modified_old_objects);
-        list_free(pr->modified_old_objects_markers);
         assert(list_is_empty(pr->large_overflow_objects));
         list_free(pr->large_overflow_objects);
         list_free(pr->young_weakrefs);
@@ -223,6 +221,8 @@
     return (pthread_t *)(tl->creating_pthread);
 }
 
+static int thread_local_counters = 0;
+
 void stm_register_thread_local(stm_thread_local_t *tl)
 {
     int num;
@@ -244,6 +244,7 @@
        numbers automatically. */
     tl->associated_segment_num = -1;
     tl->last_associated_segment_num = num + 1;
+    tl->thread_local_counter = ++thread_local_counters;
     *_get_cpth(tl) = pthread_self();
     _init_shadow_stack(tl);
     set_gs_register(get_segment_base(num + 1));
diff --git a/c8/stmgc.c b/c8/stmgc.c
--- a/c8/stmgc.c
+++ b/c8/stmgc.c
@@ -36,5 +36,6 @@
 #include "stm/extra.c"
 #include "stm/fprintcolor.c"
 #include "stm/marker.c"
+#include "stm/prof.c"
 #include "stm/rewind_setjmp.c"
 #include "stm/finalizer.c"
diff --git a/c8/stmgc.h b/c8/stmgc.h
--- a/c8/stmgc.h
+++ b/c8/stmgc.h
@@ -68,6 +68,7 @@
     /* the next fields are handled internally by the library */
     int associated_segment_num;
     int last_associated_segment_num;
+    int thread_local_counter;
     struct stm_thread_local_s *prev, *next;
     void *creating_pthread[2];
 } stm_thread_local_t;
@@ -381,12 +382,10 @@
     "gc major done"
 
 /* The markers pushed in the shadowstack are an odd number followed by a
-   regular pointer. */
+   regular object pointer. */
 typedef struct {
-    stm_thread_local_t *tl;
-    char *segment_base;    /* base to interpret the 'object' below */
-    uintptr_t odd_number;  /* marker odd number, or 0 if marker is missing */
-    object_t *object;      /* marker object, or NULL if marker is missing */
+    uintptr_t odd_number;
+    object_t *object;
 } stm_loc_marker_t;
 extern void (*stmcb_timing_event)(stm_thread_local_t *tl, /* the local thread */
                                   enum stm_event_e event,
@@ -399,10 +398,12 @@
    'profiling_file_name.fork<PID>' after a fork().  Call it with NULL to
    stop profiling.  Returns -1 in case of error (see errno then).
    The optional 'expand_marker' function pointer is called to expand
-   the marker's odd_number and object into data, starting at the given
-   position and with the given maximum length. */
+   the marker's odd_number and object into printable data, starting at
+   the given position and with the given maximum length. */
+typedef int (*stm_expand_marker_fn)(char *seg_base, stm_loc_marker_t *marker,
+                                    char *output, int output_size);
 int stm_set_timing_log(const char *profiling_file_name, int fork_mode,
-                       int expand_marker(stm_loc_marker_t *, char *, int));
+                       stm_expand_marker_fn expand_marker);
 
 
 /* Convenience macros to push the markers into the shadowstack */
diff --git a/c8/test/support.py b/c8/test/support.py
--- a/c8/test/support.py
+++ b/c8/test/support.py
@@ -149,10 +149,6 @@
 };
 
 typedef struct {
-    stm_thread_local_t *tl;
-    /* If segment_base==NULL, the remaining fields are undefined.  If non-NULL,
-       the rest is a marker to interpret from this segment_base addr. */
-    char *segment_base;
     uintptr_t odd_number;
     object_t *object;
 } stm_loc_marker_t;
@@ -162,8 +158,10 @@
                                       stm_loc_marker_t *markers);
 stmcb_timing_event_fn stmcb_timing_event;
 
-int stm_set_timing_log(const char *profiling_file_name, int prof_mode,
-                       int expand_marker(stm_loc_marker_t *, char *, int));
+typedef int (*stm_expand_marker_fn)(char *seg_base, stm_loc_marker_t *marker,
+                                    char *output, int output_size);
+int stm_set_timing_log(const char *profiling_file_name, int fork_mode,
+                       stm_expand_marker_fn expand_marker);
 
 long _stm_count_modified_old_objects(void);
 long _stm_count_objects_pointing_to_nursery(void);


More information about the pypy-commit mailing list