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

Function mrc_profiler_params_parse

libCacheSim/bin/mrcProfiler/cli_parser.cpp:367–400  ·  view source on GitHub ↗

* @brief initialize the arguments. * * @param cache_algorithm_str * @param profiler_str * @param params_str * @param mrc_size_str * @param profiler_type * @param params */

Source from the content-addressed store, hash-verified

365 * @param params
366 */
367void mrc_profiler_params_parse(const char *cache_algorithm_str,
368 const char *profiler_str, const char *params_str,
369 const char *mrc_size_str,
370 mrcProfiler::mrc_profiler_e &profiler_type,
371 mrcProfiler::mrc_profiler_params_t &params) {
372 // initial the params of mrc profiler
373 if (strcmp(profiler_str, "SHARDS") == 0 ||
374 strcmp(profiler_str, "shards") == 0) {
375 profiler_type = mrcProfiler::SHARDS_PROFILER;
376 if (strcmp(cache_algorithm_str, "LRU")) {
377 ERROR("cache algorithm must be LRU for SHARDS\n")
378 exit(1);
379 }
380
381 params.cache_algorithm_str = (char *)cache_algorithm_str;
382
383 // init shards params
384 params.shards_params.parse_params(params_str);
385 } else if (strcmp(profiler_str, "MINISIM") == 0 ||
386 strcmp(profiler_str, "minisim") == 0) {
387 profiler_type = mrcProfiler::MINISIM_PROFILER;
388
389 params.cache_algorithm_str = (char *)cache_algorithm_str;
390
391 // init minisim params
392 params.minisim_params.parse_params(params_str);
393 } else {
394 ERROR("profiler type %s not supported\n", profiler_str);
395 exit(1);
396 }
397
398 // parse mrc size
399 parse_mrc_size_params(mrc_size_str, params);
400}
401
402/**
403 * @brief initialize the arguments

Callers 1

parse_cmdFunction · 0.85

Calls 2

parse_mrc_size_paramsFunction · 0.85
parse_paramsMethod · 0.80

Tested by

no test coverage detected