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

Function read_one_req_above

libCacheSim/traceReader/reader.c:435–448  ·  view source on GitHub ↗

* read one request from reader precede current position, * in other words, read the line above current line, * and currently file points to either the end of current line or * beginning of next line * * this method is used when reading the trace from end to beginning * @param reader * @param c * @return 0 on success */

Source from the content-addressed store, hash-verified

433 * @return 0 on success
434 */
435int read_one_req_above(reader_t *const reader, request_t *req) {
436 if (reader->n_req_left > 0) {
437 reader->n_req_left -= 1;
438 req->clock_time = reader->last_req_clock_time;
439 return 0;
440 }
441
442 if (go_back_two_req(reader) == 0) {
443 return read_one_req(reader, req);
444 } else {
445 req->valid = false;
446 return 1;
447 }
448}
449
450/**
451 * skip the next following N elements in the trace,

Callers 6

test_reader_more1Function · 0.85
read_one_reqFunction · 0.85
csv_read_one_reqFunction · 0.85
runMethod · 0.85
convert_to_oracleGeneralFunction · 0.85
convert_to_lcsFunction · 0.85

Calls 2

go_back_two_reqFunction · 0.85
read_one_reqFunction · 0.85

Tested by 1

test_reader_more1Function · 0.68