X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2Fmain.c;h=58c5fa45c4bc31025375e6a4235f226662b60240;hb=273487f7b381;hp=aef97b9aeb031835f1673e2701cba46f88193f2a;hpb=d42b1300ad0b5e5e4e7c19bcfb7a0b2733b6e7c9;p=dpdk.git diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index aef97b9aeb..58c5fa45c4 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -141,16 +141,19 @@ parse_args(int argc, char **argv) int option_index; char *prgname = argv[0]; struct core_info *ci; + float branch_ratio; static struct option lgopts[] = { { "mac-updating", no_argument, 0, 1}, { "no-mac-updating", no_argument, 0, 0}, { "core-list", optional_argument, 0, 'l'}, + { "port-list", optional_argument, 0, 'p'}, + { "branch-ratio", optional_argument, 0, 'b'}, {NULL, 0, 0, 0} }; argvopt = argv; ci = get_core_info(); - while ((opt = getopt_long(argc, argvopt, "l:p:q:T:", + while ((opt = getopt_long(argc, argvopt, "l:p:q:T:b:", lgopts, &option_index)) != EOF) { switch (opt) { @@ -183,6 +186,18 @@ parse_args(int argc, char **argv) } free(oob_enable); break; + case 'b': + branch_ratio = 0.0; + if (strlen(optarg)) + branch_ratio = atof(optarg); + if (branch_ratio <= 0.0) { + printf("invalid branch ratio specified\n"); + return -1; + } + ci->branch_ratio_threshold = branch_ratio; + printf("***Setting branch ratio to %f\n", + branch_ratio); + break; /* long options */ case 0: break;