提交 6f6d8951 编写于 作者: C ChenZihang

fix a bug that NEMU take cpt can not stop

上级 08bf9456
......@@ -249,9 +249,14 @@ bool Serializer::shouldTakeCpt(uint64_t num_insts) {
void Serializer::notify_taken(uint64_t i) {
Log("Taking checkpoint @ instruction count %lu", i);
if (profiling_state == SimpointCheckpointing) {
simpoint2Weights.erase(simpoint2Weights.begin());
Log("simpoint2Weights size: %ld", simpoint2Weights.size());
if (!simpoint2Weights.empty()) {
simpoint2Weights.erase(simpoint2Weights.begin());
}
if (!simpoint2Weights.empty()) {
pathManager.incCptID();
} else {
recvd_manual_oneshot_cpt = true;
}
} else if (checkpoint_taking) {
......@@ -272,6 +277,7 @@ bool try_take_cpt(uint64_t icount) {
if (serializer.shouldTakeCpt(icount)) {
serializer.serialize(icount);
serializer.notify_taken(icount);
Log("return true");
return true;
}
return false;
......
......@@ -263,6 +263,9 @@ end_of_bb:
Logtb("prev pc = 0x%lx, pc = 0x%lx", prev_s->pc, s->pc);
Logtb("Executed %ld instructions in total, pc: 0x%lx\n", (int64_t) abs_inst_count, prev_s->pc);
}
if (manual_cpt_quit) {
Log("unlikely(manual_cpt_quit)=%ld, manual_cpt_quit=%d", unlikely(manual_cpt_quit), manual_cpt_quit);
}
if (unlikely(n <= 0)) break;
if (unlikely(manual_cpt_quit)) break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册