snapshot: remove time information
authorBrian Norris <banorris@uci.edu>
Thu, 24 May 2012 18:31:39 +0000 (11:31 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 25 May 2012 23:46:54 +0000 (16:46 -0700)
Why do we need timestamps? This is unneeded extra code and might cause
problems.

snapshot.cc
snapshotimp.h

index a092f93759473819a42998f024edc3ea492cda6c..cdc2528da14a7a1204b5fd9011a3aaf4c07784e7 100644 (file)
@@ -17,7 +17,7 @@
 #include <errno.h>
 #include <sys/wait.h>
 #include <ucontext.h>
-#include <sys/time.h>
+
 //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;
index 4991845ce37921c4cf1aa1f7d9045b08ca2994a1..2d18b94dc659e4fe4fb3d42c226e34f30d0878ea 100644 (file)
@@ -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;