From 2693d3e8789d9f06a66aa9cd612a395c2cf649ea Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 8 Oct 2012 19:34:43 -0700 Subject: [PATCH] datarace: reformat datarace printing --- datarace.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/datarace.cc b/datarace.cc index f5501fe..7fe5350 100644 --- a/datarace.cc +++ b/datarace.cc @@ -120,11 +120,15 @@ bool checkDataRaces() { 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. */ -- 2.34.1