From: Brian Norris Date: Thu, 24 May 2012 18:31:39 +0000 (-0700) Subject: snapshot: remove time information X-Git-Tag: pldi2013~392^2~38 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2906f608d81ce100d3771fd04be61722e60a795d;p=model-checker.git snapshot: remove time information Why do we need timestamps? This is unneeded extra code and might cause problems. --- diff --git a/snapshot.cc b/snapshot.cc index a092f93..cdc2528 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -17,7 +17,7 @@ #include #include #include -#include + //extern declaration definition #define FAILURE(mesg) { printf("failed in the API: %s with errno relative message: %s\n", mesg, strerror( errno ) ); exit( -1 ); } #if USE_CHECKPOINTING @@ -26,24 +26,13 @@ struct Snapshot_t * sTheRecord = NULL; #else struct Snapshot_t * sTheRecord = NULL; #endif -void BeginOperation( struct timeval * theStartTime ){ -#if 1 - gettimeofday( theStartTime, NULL ); -#endif -} -#if SSDEBUG -struct timeval *starttime = NULL; -#endif void DumpIntoLog( const char * filename, const char * message ){ #if SSDEBUG static pid_t thePID = getpid(); char newFn[ 1024 ] ={ 0 }; sprintf( newFn,"%s-%d.txt", filename, thePID ); FILE * myFile = fopen( newFn, "w+" ); - struct timeval theEndTime; - BeginOperation( &theEndTime ); - double elapsed = ( theEndTime.tv_sec - starttime->tv_sec ) + ( theEndTime.tv_usec - starttime->tv_usec ) / 1000000.0; - fprintf( myFile, "The timestamp %f:--> the message %s: the process id %d\n", elapsed, message, thePID ); + fprintf( myFile, "the message %s: the process id %d\n", message, thePID ); fflush( myFile ); fclose( myFile ); myFile = NULL; @@ -167,10 +156,7 @@ void initSnapShotLibrary(unsigned int numbackingpages, unsigned int numsnapshots exit(-1); } createSharedLibrary(); -#if SSDEBUG - starttime = &(sTheRecord->startTimeGlobal); - gettimeofday( starttime, NULL ); -#endif + //step 2 setup the stack context. int alreadySwapped = 0; diff --git a/snapshotimp.h b/snapshotimp.h index 4991845..2d18b94 100644 --- a/snapshotimp.h +++ b/snapshotimp.h @@ -61,9 +61,6 @@ size_t mStackSize; snapshot_id mIDToRollback; ucontext_t mContextToRollback; snapshot_id currSnapShotID; -#if SSDEBUG -struct timeval startTimeGlobal; -#endif volatile bool mbFinalize; }; extern struct Snapshot_t * sTheRecord;