* @brief convert a given trace to lcs format * * there are multiple versions of lcs format see lcs.h for more details * each version has a different request struct format, however, all lcs traces have * the same header format which stores the version and trace statistics * * * see traceReader/generalReader/lcs.h for more details * * * @param argc * @param argv * @return int */
| 24 | * @return int |
| 25 | */ |
| 26 | int main(int argc, char *argv[]) { |
| 27 | struct arguments args; |
| 28 | |
| 29 | cli::parse_cmd(argc, argv, &args); |
| 30 | if (strlen(args.ofilepath) == 0) { |
| 31 | snprintf(args.ofilepath, OFILEPATH_LEN, "%s.%s", args.trace_path, args.output_format); |
| 32 | } |
| 33 | |
| 34 | INFO("output format %s, output path %s\n", args.output_format, args.ofilepath); |
| 35 | if (strcasecmp(args.output_format, "lcs") == 0 || strcasecmp(args.output_format, "lcs_v1") == 0) { |
| 36 | traceConv::convert_to_lcs(args.reader, args.ofilepath, args.output_txt, args.remove_size_change, 1); |
| 37 | } else if (strcasecmp(args.output_format, "lcs_v2") == 0) { |
| 38 | traceConv::convert_to_lcs(args.reader, args.ofilepath, args.output_txt, args.remove_size_change, 2); |
| 39 | } else if (strcasecmp(args.output_format, "lcs_v3") == 0) { |
| 40 | traceConv::convert_to_lcs(args.reader, args.ofilepath, args.output_txt, args.remove_size_change, 3); |
| 41 | } else if (strcasecmp(args.output_format, "lcs_v4") == 0) { |
| 42 | traceConv::convert_to_lcs(args.reader, args.ofilepath, args.output_txt, args.remove_size_change, 4); |
| 43 | } else if (strcasecmp(args.output_format, "lcs_v5") == 0) { |
| 44 | traceConv::convert_to_lcs(args.reader, args.ofilepath, args.output_txt, args.remove_size_change, 5); |
| 45 | } else if (strcasecmp(args.output_format, "lcs_v6") == 0) { |
| 46 | traceConv::convert_to_lcs(args.reader, args.ofilepath, args.output_txt, args.remove_size_change, 6); |
| 47 | } else if (strcasecmp(args.output_format, "lcs_v7") == 0) { |
| 48 | traceConv::convert_to_lcs(args.reader, args.ofilepath, args.output_txt, args.remove_size_change, 7); |
| 49 | } else if (strcasecmp(args.output_format, "lcs_v8") == 0) { |
| 50 | traceConv::convert_to_lcs(args.reader, args.ofilepath, args.output_txt, args.remove_size_change, 8); |
| 51 | } else if (strcasecmp(args.output_format, "oracleGeneral") == 0) { |
| 52 | traceConv::convert_to_oracleGeneral(args.reader, args.ofilepath, args.output_txt, args.remove_size_change); |
| 53 | } else { |
| 54 | ERROR("unknown output format %s\n", args.output_format); |
| 55 | exit(1); |
| 56 | } |
| 57 | } |
nothing calls this directly
no test coverage detected