Changeset f85546d in mainline
- Timestamp:
- 2019-01-04T15:00:21Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 13b1b48
- Parents:
- a362c16
- Location:
- uspace/app/perf
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/perf/Makefile
ra362c16 rf85546d 36 36 benchlist.c \ 37 37 csv.c \ 38 params.c \ 38 39 perf.c \ 39 40 ipc/ns_ping.c \ -
uspace/app/perf/perf.c
ra362c16 rf85546d 49 49 #include "benchlist.h" 50 50 #include "csv.h" 51 #include "params.h" 51 52 #include "perf.h" 52 53 … … 299 300 printf("-o, --output filename.csv " 300 301 "Store machine-readable data in filename.csv\n"); 302 printf("-p, --param KEY=VALUE " 303 "Additional parameters for the benchmark\n"); 301 304 printf("<benchmark> is one of the following:\n"); 302 305 list_benchmarks(); 303 306 } 304 307 308 static void handle_param_arg(char *arg) 309 { 310 char *value = NULL; 311 char *key = str_tok(arg, "=", &value); 312 bench_param_set(key, value); 313 } 314 305 315 int main(int argc, char *argv[]) 306 316 { 307 const char *short_options = "ho:"; 317 errno_t rc = bench_param_init(); 318 if (rc != EOK) { 319 fprintf(stderr, "Failed to initialize internal params structure: %s\n", 320 str_error(rc)); 321 return -5; 322 } 323 324 const char *short_options = "ho:p:"; 308 325 struct option long_options[] = { 309 326 { "help", optional_argument, NULL, 'h' }, 327 { "param", required_argument, NULL, 'p' }, 310 328 { "output", required_argument, NULL, 'o' }, 311 329 { 0, 0, NULL, 0 } … … 322 340 case 'o': 323 341 csv_output_filename = optarg; 342 break; 343 case 'p': 344 handle_param_arg(optarg); 324 345 break; 325 346 case -1: … … 366 387 367 388 csv_report_close(); 389 bench_param_cleanup(); 368 390 369 391 return exit_code;
Note:
See TracChangeset
for help on using the changeset viewer.