Commits

Armin Rigo committed 17d596a

import stmgc/4ed9ba1552f8 and hack to always print aborts

Comments (0)

Files changed (3)

rpython/translator/stm/src_stm/et.c

 
 void AbortTransaction(int num)
 {
+  static const char *abort_names[] = ABORT_NAMES;
   struct tx_descriptor *d = thread_descriptor;
   unsigned long limit;
   struct timespec now;
   stm_invoke_callbacks_on_abort(d);
   stm_clear_callbacks_on_abort(d);
 
+  fprintf(stderr, "[%lx] abort %s\n",
+          (long)d->public_descriptor_index, abort_names[num]);
   dprintf(("\n"
           "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
           "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
-          "!!!!!!!!!!!!!!!!!!!!!  [%lx] abort %d\n"
+          "!!!!!!!!!!!!!!!!!!!!!  [%lx] abort %s\n"
           "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
           "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
-          "\n", (long)d->public_descriptor_index, num));
+          "\n", (long)d->public_descriptor_index, abort_names[num]));
   if (num != ABRT_MANUAL && d->max_aborts >= 0 && !d->max_aborts--)
     stm_fatalerror("unexpected abort!\n");
 
                 (XXX statically we should know when we're outside
                 a transaction) */
 
-  fprintf(stderr, "[%lx] inevitable: %s\n",
-           (long)d->public_descriptor_index, why);
+  dprintf(("[%lx] inevitable: %s\n",
+           (long)d->public_descriptor_index, why));
 
   cur_time = acquire_inev_mutex_and_mark_global_cur_time(d);
   if (d->start_time != cur_time)

rpython/translator/stm/src_stm/et.h

 #define ABRT_COLLECT_MINOR        6
 #define ABRT_COLLECT_MAJOR        7
 #define ABORT_REASONS         8
+#define ABORT_NAMES      { "MANUAL",            \
+                           "COMMIT",            \
+                           "STOLEN_MODIFIED",   \
+                           "VALIDATE_INFLIGHT", \
+                           "VALIDATE_COMMIT",   \
+                           "VALIDATE_INEV",     \
+                           "COLLECT_MINOR",     \
+                           "COLLECT_MAJOR",     \
+                         }
 
 #define SPLP_ABORT                0
 #define SPLP_LOCKED_INFLIGHT      1

rpython/translator/stm/src_stm/revision

-0b3f7830cb46
+4ed9ba1552f8