MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / run

Method run

libCacheSim/traceAnalyzer/analyzer.cpp:88–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void traceAnalyzer::TraceAnalyzer::run() {
89 if (has_run_) return;
90
91 request_t *req = new_request();
92 read_one_req(reader_, req);
93 start_ts_ = req->clock_time;
94 int32_t curr_time_window_idx = 0;
95 int next_time_window_ts = time_window_;
96
97 int64_t n = 0;
98 /* going through the trace */
99 do {
100 DEBUG_ASSERT(req->obj_size != 0);
101
102 // change real time to relative time
103 req->clock_time -= start_ts_;
104
105 while (req->clock_time >= next_time_window_ts) {
106 curr_time_window_idx += 1;
107 next_time_window_ts += time_window_;
108 }
109
110 if (curr_time_window_idx != time_to_window_idx(req->clock_time)) {
111 ERROR(
112 "The data is not ordered by time, please sort the trace first!"
113 "Current time %ld requested object %lu, obj size %lu\n",
114 (long)(req->clock_time + start_ts_), (unsigned long)req->obj_id,
115 (long)req->obj_size);
116 }
117
118 DEBUG_ASSERT(curr_time_window_idx == time_to_window_idx(req->clock_time));
119
120 n_req_ += 1;
121 sum_obj_size_req += req->obj_size;
122
123 auto it = obj_map_.find(req->obj_id);
124 if (it == obj_map_.end()) {
125 /* the first request to the object */
126 req->compulsory_miss =
127 true; /* whether the object is seen for the first time */
128 req->overwrite = false;
129 req->first_seen_in_window = true;
130 req->create_rtime = (int32_t)req->clock_time;
131 req->prev_size = -1;
132 // req->last_seen_window_idx = curr_time_window_idx;
133
134 req->vtime_since_last_access = -1;
135 req->rtime_since_last_access = -1;
136
137 struct obj_info obj_info;
138 obj_info.create_rtime = (int32_t)req->clock_time;
139 obj_info.freq = 1;
140 obj_info.obj_size = (obj_size_t)req->obj_size;
141 obj_info.last_access_rtime = (int32_t)req->clock_time;
142 obj_info.last_access_vtime = n_req_;
143
144 obj_map_[req->obj_id] = obj_info;
145 sum_obj_size_obj += req->obj_size;

Callers 11

run_mrcprofiler_sizeFunction · 0.45
run_cachesim_sizeFunction · 0.45
run_cachesim_timeFunction · 0.45
run_mrc_binaryFunction · 0.45
generate_traceFunction · 0.45
run_cachesimFunction · 0.45
install_dependencyFunction · 0.45
compile_cachesimFunction · 0.45

Calls 8

new_requestFunction · 0.85
read_one_reqFunction · 0.85
assertFunction · 0.85
free_requestFunction · 0.85
findMethod · 0.45
endMethod · 0.45
add_reqMethod · 0.45
dumpMethod · 0.45