Skip to content

Commit

Permalink
make the logging more useful when the trace is not sorted by time
Browse files Browse the repository at this point in the history
  • Loading branch information
1a1a11a committed Oct 15, 2023
1 parent 4a9b24c commit 82e76bd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libCacheSim/traceAnalyzer/analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// Created by Juncheng on 6/5/21.
//

#include "analyzer.h"

#include <algorithm> // std::make_heap, std::pop_heap, std::push_heap, std::sort_heap
#include <vector> // std::vector

#include "analyzer.h"
#include "utils/include/utils.h"

void traceAnalyzer::TraceAnalyzer::initialize() {
Expand Down Expand Up @@ -108,6 +107,13 @@ void traceAnalyzer::TraceAnalyzer::run() {
next_time_window_ts += time_window_;
}

if (curr_time_window_idx != time_to_window_idx(req->clock_time)) {
ERROR(
"The data is not ordered by time, please sort the trace first!"
"Current time %ld requested object %lu\n",
req->clock_time + start_ts_, req->obj_id);
}

DEBUG_ASSERT(curr_time_window_idx == time_to_window_idx(req->clock_time));

n_req_ += 1;
Expand Down

0 comments on commit 82e76bd

Please sign in to comment.