| 12 | #endif |
| 13 | |
| 14 | static 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 | |
| 35 | static 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", |
no outgoing calls
no test coverage detected