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

Function get_num_of_req

libCacheSim/traceReader/reader.c:514–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514int64_t get_num_of_req(reader_t *const reader) {
515 if (reader->n_total_req > 0) return reader->n_total_req;
516
517 int64_t n_req = 0;
518
519 if (reader->trace_format == TXT_TRACE_FORMAT || reader->is_zstd_file) {
520 reader_t *reader_copy = clone_reader(reader);
521 reader_copy->mmap_offset = 0;
522 request_t *req = new_request();
523 while (read_one_req(reader_copy, req) == 0) {
524 n_req++;
525 }
526 free_request(req);
527 close_reader(reader_copy);
528 } else {
529 ERROR("should not reach here\n");
530 abort();
531 }
532 reader->n_total_req = n_req;
533 return n_req;
534}
535
536reader_t *clone_reader(const reader_t *const reader_in) {
537 reader_t *reader = setup_reader(reader_in->trace_path, reader_in->trace_type,

Callers 15

test_distUtils_basicFunction · 0.85
test_distUtils_more1Function · 0.85
test_profilerLRU_basicFunction · 0.85
test_reader_basicFunction · 0.85
test_reader_more1Function · 0.85
test_twrFunction · 0.85
ScanDetectorMethod · 0.85
get_lru_obj_miss_ratioFunction · 0.85
_get_lru_miss_cntFunction · 0.85
get_stack_distFunction · 0.85
get_access_distFunction · 0.85
save_distFunction · 0.85

Calls 5

clone_readerFunction · 0.85
new_requestFunction · 0.85
read_one_reqFunction · 0.85
free_requestFunction · 0.85
close_readerFunction · 0.85

Tested by 6

test_distUtils_basicFunction · 0.68
test_distUtils_more1Function · 0.68
test_profilerLRU_basicFunction · 0.68
test_reader_basicFunction · 0.68
test_reader_more1Function · 0.68
test_twrFunction · 0.68