Skip to content

Commit

Permalink
Writing data (time,BC) into record.dat for graph plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
sanghu1790 committed Oct 16, 2018
1 parent 9aa67e7 commit 967aad8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/Core/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,10 +1480,9 @@ void Executor::transferToBasicBlock(BasicBlock *dst, BasicBlock *src,
PHINode *first = static_cast<PHINode*>(state.pc->inst);
state.incomingBBIndex = first->getBasicBlockIndex(src);
}
// if (INTERPOLATION_ENABLED)
if (INTERPOLATION_ENABLED)
// blockCount increased to count all visited Basic Blocks

// TxTree::blockCount++;
TxTree::blockCount++;
//llvm::outs() << "**************\n";
//dst->back().dump();

Expand All @@ -1506,7 +1505,8 @@ void Executor::transferToBasicBlock(BasicBlock *dst, BasicBlock *src,
outfile.open ("Livecoverage.txt", std::ofstream::app);
std::ofstream outfile1;
outfile1.open ("LogBlockCoverage.txt", std::ofstream::app);

std::ofstream outfile2;
outfile2.open ("record.dat", std::ofstream::app);

//outfile << "Sanghu";
//ios::out | ios::app | ios::binary
Expand Down Expand Up @@ -1552,6 +1552,7 @@ void Executor::transferToBasicBlock(BasicBlock *dst, BasicBlock *src,
diff = now - startingTime;
float blockCoverage;
strftime(buf, sizeof(buf), "%T", &tstruct);

blockCoverage = ((float)visitedBlocks.size() / (float)allblockcount) * 100;
if((diff == checkpointinitial) || (diff == checkpoint1) || (diff == checkpoint2) || (diff == checkpoint3) || (diff == checkpoint4) || (diff == checkpoint5) || (diff == checkpoint6) )
{
Expand Down Expand Up @@ -1585,7 +1586,7 @@ void Executor::transferToBasicBlock(BasicBlock *dst, BasicBlock *src,
outfile << "************Visited Blocks Ends Live****************" << "\n";
}
outfile1 << "[" << buf << "," << "(" << visitedBlocks.size() << "," << allblockcount << "," << std::fixed << std::setprecision(2) << blockCoverage << "%)]" << "\n";

outfile2 << diff << " " << std::fixed << std::setprecision(2) << blockCoverage << "\n";
//----TRY to implement Live Coverage Ends

//kf->function->dump();
Expand Down

0 comments on commit 967aad8

Please sign in to comment.