[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 10/11] tools/xenpm: Print CPPC parameters for amd-pstate driver


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Tue, 3 Dec 2024 16:33:15 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RXdS+5gaEuT5scthbVrK+h/Gd+9a+0HPlHnCGnSwq/E=; b=vqV0RyrduVTjgNNgd9fjpRhcPZP9q+/4M7tsvszpHCD1iACvmy5bUvJAmL6TfdAS96J6jgDzzpStHJfe8fZ4OWYks0Wt/6WmNRwNqbhRmroF79clup3cNlp8E7RvcYNJ+4AS0yAo2Y/YlChWwDkuwaNnJRpP9/Y1q1RAdQI4S2SoTP/2k5yhGHsI2NhuEacJA2H1doWXU+dFpGBuko2Wuqm48PZJRWwuMwjIXKwmOacSkx0bG+USe/eFYSdZvp+/uz1Zt0A/wEoxS1C37nWvypg2G+gV+FOIN4X5iao0JfasGTN4R+uM83e7u+uJ5OOGLTgUYR7HVGfV8Rf1T9Ltxg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kGUnxo5t0m9NqVOFemeqC81wDB5Iw45KtrjSJl63SuK8e+IZBWm68kijv1HZ4p7eemMgzuVO3weDd5tC41xM8xZGhRWdyh2W/aXrPddGwSQo9vbu1cJUQyb1u0zH8Svhe6oR302AKLReoX26lZrWual5vV/XyhOh4ekPKDk8xXUzo6IKpVXROj2Dn+5OLdZJ+6BCM7RQXFbbzWm9NxQYb8fpipWSrV+2IpJy68leN6134P56IpdZdQNCw3qp0q4vlDENYH3GNsnMq+q0rko05VtAHIKufwZ1lL/GoTTRvFrCQhI22xTe1sxMKTZh62zzNDG3uOUYCOHL8rdkdtTVDQ==
  • Cc: <stefano.stabellini@xxxxxxx>, <Ray.Huang@xxxxxxx>, <Xenia.Ragiadakou@xxxxxxx>, <Jason.Andryuk@xxxxxxx>, <penny.zheng@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • Delivery-date: Tue, 03 Dec 2024 08:35:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Penny Zheng <penny.zheng@xxxxxxx>

HWP, amd-pstate, amd-pstate-epp are all the implementation
of ACPI CPPC (Collaborative Processor Performace Control),
so we introduce cppc_mode flag to print CPPC-related para.

And HWP and amd-pstate-epp are both governor-less driver,
so we introduce hw_auto flag to bypass governor-related print.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
 tools/misc/xenpm.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 336d246346..a09b53c4f3 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -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);
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.