datarace: reformat datarace printing
authorBrian Norris <banorris@uci.edu>
Tue, 9 Oct 2012 02:34:43 +0000 (19:34 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 9 Oct 2012 02:57:12 +0000 (19:57 -0700)
datarace.cc

index f5501fe..7fe5350 100644 (file)
@@ -120,11 +120,15 @@ bool checkDataRaces() {
        return false;
 }
 
        return false;
 }
 
-void printRace(struct DataRace * race) {
-       printf("Datarace detected\n");
-       printf("Location %p\n", race->address);
-       printf("Initial access: thread %u clock %u, iswrite %u\n", id_to_int(race->oldthread), race->oldclock, race->isoldwrite);
-       printf("Second access: thread %u clock %u, iswrite %u\n", id_to_int(race->newaction->get_tid()), race->newaction->get_seq_number(), race->isnewwrite);
+void printRace(struct DataRace *race)
+{
+       printf("Datarace detected @ address %p:\n", race->address);
+       printf("    Access 1: %5s in thread %2d @ clock %3u\n",
+                       race->isoldwrite ? "write" : "read",
+                       id_to_int(race->oldthread), race->oldclock);
+       printf("    Access 2: %5s in thread %2d @ clock %3u\n",
+                       race->isnewwrite ? "write" : "read",
+                       id_to_int(race->newaction->get_tid()), race->newaction->get_seq_number());
 }
 
 /** This function does race detection for a write on an expanded record. */
 }
 
 /** This function does race detection for a write on an expanded record. */