gettimeofday( theStartTime, NULL );
#endif
}
-#if DEBUG
+#if SSDEBUG
struct timeval *starttime = NULL;
#endif
void DumpIntoLog( const char * filename, const char * message ){
-#if DEBUG
+#if SSDEBUG
static pid_t thePID = getpid();
char newFn[ 1024 ] ={ 0 };
sprintf( newFn,"%s-%d.txt", filename, thePID );
#ifdef __cplusplus
}
#endif
-void initSnapShotLibrary(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions , MyFuncPtr entryPoint){
+void initSnapShotLibrary(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions, unsigned int numheappages, MyFuncPtr entryPoint){
#if USE_CHECKPOINTING
struct sigaction sa;
sa.sa_flags = SA_SIGINFO | SA_NODEFER | SA_RESTART;
exit(-1);
}
initSnapShotRecord(numbackingpages, numsnapshots, nummemoryregions);
+ mySpace = create_mspace( numheappages*PAGESIZE, 1 );
+ addMemoryRegionToSnapShot(mySpace, numheappages);
entryPoint();
#else
//add a signal to indicate that the process is going to terminate.
exit(-1);
}
createSharedLibrary();
- #if DEBUG
+ #if SSDEBUG
starttime = &(sTheRecord->startTimeGlobal);
gettimeofday( starttime, NULL );
#endif
} else {
int status;
int retVal;
-#if DEBUG
+#if SSDEBUG
char mesg[ 1024 ] = { 0 };
sprintf( mesg, "The process id of child is %d and the process id of this process is %d and snapshot id is %d", forkedID, getpid(), snapshotid );
DumpIntoLog( "ModelSnapshot", mesg );
getcontext( &sTheRecord->mContextToRollback );
if( !sTemp ){
sTemp = 1;
-#if DEBUG
+#if SSDEBUG
DumpIntoLog( "ModelSnapshot", "Invoked rollback" );
#endif
exit( 0 );