* @brief initialize the arguments. * * @param cache_algorithm_str * @param profiler_str * @param params_str * @param mrc_size_str * @param profiler_type * @param params */
| 365 | * @param params |
| 366 | */ |
| 367 | void 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 ¶ms) { |
| 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 |
no test coverage detected