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) {
}
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;
/* Number of microseconds between each poll */
#define INTERVAL 100
#define PRINT_LOOP_COUNT (1000000/INTERVAL)
-#define RATIO_THRESHOLD 0.03
#define IA32_PERFEVTSEL0 0x186
#define IA32_PERFEVTSEL1 0x187
#define IA32_PERFCTR0 0xc1
ratio = (float)miss_diff * (float)100 / (float)hits_diff;
- if (ratio < RATIO_THRESHOLD)
+ if (ratio < ci->branch_ratio_threshold)
power_manager_scale_core_min(core);
else
power_manager_scale_core_max(core);
ci = get_core_info();
ci->core_count = get_nprocs_conf();
+ ci->branch_ratio_threshold = BRANCH_RATIO_THRESHOLD;
ci->cd = malloc(ci->core_count * sizeof(struct core_details));
if (!ci->cd) {
RTE_LOG(ERR, POWER_MANAGER, "Failed to allocate memory for core info.");