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

Function print_parsed_arg

libCacheSim/bin/traceUtils/cli_parser.cpp:187–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185 "--filter fifo --filter-size 0.1\n\n";
186
187static void print_parsed_arg(struct arguments *args) {
188#define OUTPUT_STR_LEN 1024
189 int n = 0;
190 char output_str[OUTPUT_STR_LEN];
191 n = snprintf(output_str, OUTPUT_STR_LEN - 1, "trace path: %s, trace_type %s",
192 args->trace_path, g_trace_type_name[args->trace_type]);
193
194 if (args->trace_type_params != NULL)
195 n += snprintf(output_str + n, OUTPUT_STR_LEN - n - 1,
196 ", trace type params: %s", args->trace_type_params);
197
198 if (args->sample_ratio < 1.0)
199 n += snprintf(output_str + n, OUTPUT_STR_LEN - n - 1, ", sample ratio: %lf",
200 args->sample_ratio);
201
202 if (args->n_req != -1)
203 n += snprintf(output_str + n, OUTPUT_STR_LEN - n - 1,
204 ", num requests to process: %ld", (long)args->n_req);
205
206 if (args->output_txt)
207 n += snprintf(output_str + n, OUTPUT_STR_LEN - n - 1,
208 ", output txt trace: true");
209
210 if (args->remove_size_change)
211 n += snprintf(output_str + n, OUTPUT_STR_LEN - n - 1,
212 ", remove size change during traceConv");
213
214 if (args->ignore_obj_size)
215 n += snprintf(output_str + n, OUTPUT_STR_LEN - n - 1,
216 ", ignore object size");
217
218 snprintf(output_str + n, OUTPUT_STR_LEN - n - 1, "\n");
219
220 INFO("%s", output_str);
221
222#undef OUTPUT_STR_LEN
223}
224
225/**
226 * @brief parse the command line arguments

Callers 1

parse_cmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected