#include "dram_tracer_create.h" #include #include #include #include #include #include static droption_t op_trace_dir(DROPTION_SCOPE_FRONTEND, "trace_dir", "", "[Required] Trace input directory", "Specifies the directory containing the trace files to be analyzed."); static droption_t op_output_dir(DROPTION_SCOPE_FRONTEND, "output_dir", "", "Trace output directory", "Specifies the directory of the trace files to output."); int _tmain(int argc, const TCHAR *targv[]) { // Convert to UTF-8 if necessary char **argv; drfront_status_t sc = drfront_convert_args(targv, &argv, argc); if (sc != DRFRONT_SUCCESS) { fmt::print("Failed to process args: {}", sc); exit(1); } std::string parse_err; if (!droption_parser_t::parse_argv(DROPTION_SCOPE_FRONTEND, argc, (const char **)argv, &parse_err, NULL) || op_trace_dir.get_value().empty()) { fmt::print("Usage error: {}\nUsage:\n{}", parse_err.c_str(), droption_parser_t::usage_short(DROPTION_SCOPE_ALL).c_str()); exit(1); } std::array tools{dram_tracer_create(op_output_dir.get_value())}; analyzer_t analyzer(op_trace_dir.get_value(), tools.data(), (int)tools.size()); analyzer.run(); analyzer.print_stats(); for (auto tool : tools) delete tool; }