Skip to content

Commit

Permalink
Fix off-by-one error in trace-line logging with coalesced USR_SCHEDs.
Browse files Browse the repository at this point in the history
  • Loading branch information
joneschrisg committed Oct 3, 2013
1 parent a5d707e commit cce1a02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/replayer/rep_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ struct task* rep_sched_get_thread()
t->trace.rbc = rbc;
}
}
assert(get_global_time() == t->trace.global_time);
return t;
}

Expand Down
2 changes: 2 additions & 0 deletions src/share/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,11 @@ void peek_next_trace(struct trace_frame *trace)
fpos_t pos;
fgetpos(trace_file, &pos);
int saved_trace_file_lines_counter = trace_file_lines_counter;
uint32_t saved_global_time = global_time;
read_next_trace(trace);
/* check if read is successful */
assert(!feof(trace_file));
global_time = saved_global_time;
trace_file_lines_counter = saved_trace_file_lines_counter;
fsetpos(trace_file, &pos);
}
Expand Down

0 comments on commit cce1a02

Please sign in to comment.