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

Function _verify_lcs_header

libCacheSim/traceReader/customizedReader/lcs.c:14–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#endif
13
14static bool _verify_lcs_header(lcs_trace_header_t *header) {
15 /* check whether the trace is valid */
16 if (header->start_magic != LCS_TRACE_START_MAGIC) {
17 ERROR("invalid trace file, start magic is wrong 0x%lx\n", (unsigned long)header->start_magic);
18 return false;
19 }
20
21 if (header->end_magic != LCS_TRACE_END_MAGIC) {
22 ERROR("invalid trace file, end magic is wrong 0x%lx\n", (unsigned long)header->end_magic);
23 return false;
24 }
25
26 lcs_trace_stat_t *stat = &(header->stat);
27 if (stat->n_req < 0 || stat->n_obj < 0) {
28 ERROR("invalid trace file, n_req %ld, n_obj %ld\n", (unsigned long)stat->n_req, (unsigned long)stat->n_obj);
29 return false;
30 }
31
32 return true;
33}
34
35static void _lcs_print_trace_stat(lcs_trace_stat_t *stat) {
36 printf("trace stat: n_req %lld, n_obj %lld, n_byte %lld (%.2lf GiB), n_uniq_byte %lld (%.2lf GiB)\n",

Callers 2

lcsReader_setupFunction · 0.85
lcs_print_trace_statFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected