Commits

Armin Rigo  committed 4ed9ba1

Print the full name of the abort reason

  • Participants
  • Parent commits 0b3f783

Comments (0)

Files changed (2)

 
 void AbortTransaction(int num)
 {
+  static const char *abort_names[] = ABORT_NAMES;
   struct tx_descriptor *d = thread_descriptor;
   unsigned long limit;
   struct timespec now;
   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");
 
 #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