@@ -787,12 +787,22 @@ static unsigned int calculate_activity_window(const xc_cppc_para_t *cppc,
return mantissa * multiplier;
}
+
/* print out parameters about cpu frequency */
static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
{
- bool hwp = strcmp(p_cpufreq->scaling_driver, XEN_HWP_DRIVER_NAME) == 0;
+ bool cppc_mode = false, hw_auto = false;
int i;
+ if ( !strcmp(p_cpufreq->scaling_driver, XEN_HWP_DRIVER_NAME) ||
+ !strcmp(p_cpufreq->scaling_driver, XEN_AMD_PSTATE_DRIVER_NAME) ||
+ !strcmp(p_cpufreq->scaling_driver, XEN_AMD_PSTATE_EPP_DRIVER_NAME) )
+ cppc_mode = true;
+
+ if ( !strcmp(p_cpufreq->scaling_driver, XEN_HWP_DRIVER_NAME) ||
+ !strcmp(p_cpufreq->scaling_driver, XEN_AMD_PSTATE_EPP_DRIVER_NAME) )
+ hw_auto = true;
+
printf("cpu id : %d\n", cpuid);
printf("affected_cpus :");
@@ -800,7 +810,7 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
printf(" %d", p_cpufreq->affected_cpus[i]);
printf("\n");
- if ( hwp )
+ if ( hw_auto )
printf("cpuinfo frequency : base [%"PRIu32"] max [%"PRIu32"]\n",
p_cpufreq->cpuinfo_min_freq,
p_cpufreq->cpuinfo_max_freq);
@@ -812,7 +822,7 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
printf("scaling_driver : %s\n", p_cpufreq->scaling_driver);
- if ( hwp )
+ if ( cppc_mode )
{
const xc_cppc_para_t *cppc = &p_cpufreq->u.cppc_para;
@@ -838,7 +848,8 @@ static void print_cpufreq_para(int cpuid, struct xc_get_cpufreq_para *p_cpufreq)
cppc->desired,
cppc->desired ? "" : " hw autonomous");
}
- else
+
+ if ( !hw_auto )
{
printf("scaling_avail_gov : %s\n",
p_cpufreq->scaling_available_governors);