diff mbox series

[Resend,7/8] tools/power x86_energy_perf_policy: rename some perf output strings for AMD processors

Message ID 5f70fe6c01a05dc355d6a0e47d32d5e24500ca82.1706592301.git.perry.yuan@amd.com (mailing list archive)
State Changes Requested, archived
Headers show
Series enable x86_energy_perf_policy for AMD CPU | expand

Commit Message

Yuan, Perry Jan. 30, 2024, 5:56 a.m. UTC
rename some perf strings using same definition for AMD CPPC performance
capabilities.

cpu0: [AMD HWP_REQ]: lowest 12 highest 166 desired 0 epp 128 window
0x131497d0 (80*10^7us) use_pkg 89

cpu1: [AMD HWP_REQ]: lowest 12 highest 166 desired 0 epp 128 window
0x131497d0 (80*10^7us) use_pkg 89

Signed-off-by: Perry Yuan <perry.yuan@amd.com>
---
 .../x86_energy_perf_policy.c                  | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)

Comments

Mario Limonciello Jan. 30, 2024, 7:54 p.m. UTC | #1
On 1/29/2024 23:56, Perry Yuan wrote:
> rename some perf strings using same definition for AMD CPPC performance
> capabilities.

I'm not sure I get why these need to deviate.  The nomenclature is 
clearer for everyone this way isn't it?  So why not just make the same 
change for everyone (IE min->lowest, max->highest, des->desired)?

> 
> cpu0: [AMD HWP_REQ]: lowest 12 highest 166 desired 0 epp 128 window
> 0x131497d0 (80*10^7us) use_pkg 89
> 
> cpu1: [AMD HWP_REQ]: lowest 12 highest 166 desired 0 epp 128 window
> 0x131497d0 (80*10^7us) use_pkg 89
> 
> Signed-off-by: Perry Yuan <perry.yuan@amd.com>
> ---
>   .../x86_energy_perf_policy.c                  | 23 ++++++++++++++-----
>   1 file changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
> index ada1aaabad8c..845cfedab06e 100644
> --- a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
> +++ b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
> @@ -864,10 +864,15 @@ void print_hwp_request(int cpu, struct msr_hwp_request *h, char *str)
>   
>   	if (str)
>   		printf("%s", str);
> +	if (genuine_intel)
> +		printf("HWP_REQ: min %d max %d des %d epp %d window 0x%x (%d*10^%dus) use_pkg %d\n",
> +			h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
> +			h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7, h->hwp_use_pkg);
> +	else if (authentic_amd)
> +		printf("[AMD HWP_REQ]: lowest %d highest %d desired %d epp %d window 0x%x (%d*10^%dus) use_pkg %d\n",
> +			h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
> +			h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7, h->hwp_use_pkg);
>   
> -	printf("HWP_REQ: min %d max %d des %d epp %d window 0x%x (%d*10^%dus) use_pkg %d\n",
> -		h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
> -		h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7, h->hwp_use_pkg);
>   }
>   void print_hwp_request_pkg(int pkg, struct msr_hwp_request *h, char *str)
>   {
> @@ -876,9 +881,15 @@ void print_hwp_request_pkg(int pkg, struct msr_hwp_request *h, char *str)
>   	if (str)
>   		printf("%s", str);
>   
> -	printf("HWP_REQ_PKG: min %d max %d des %d epp %d window 0x%x (%d*10^%dus)\n",
> -		h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
> -		h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7);
> +	if (genuine_intel) {
> +		printf("HWP_REQ_PKG: min %d max %d des %d epp %d window 0x%x (%d*10^%dus)\n",
> +			h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
> +			h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7);
> +	} else if (authentic_amd) {
> +		printf("AMD HWP_REQ_PKG: lowest %d highest %d desired %d epp %d window 0x%x (%d*10^%dus)\n",
> +			h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
> +			h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7);
> +	}
>   }
>   void read_hwp_request(int cpu, struct msr_hwp_request *hwp_req, unsigned int msr_offset)
>   {
diff mbox series

Patch

diff --git a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
index ada1aaabad8c..845cfedab06e 100644
--- a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
+++ b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
@@ -864,10 +864,15 @@  void print_hwp_request(int cpu, struct msr_hwp_request *h, char *str)
 
 	if (str)
 		printf("%s", str);
+	if (genuine_intel)
+		printf("HWP_REQ: min %d max %d des %d epp %d window 0x%x (%d*10^%dus) use_pkg %d\n",
+			h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
+			h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7, h->hwp_use_pkg);
+	else if (authentic_amd)
+		printf("[AMD HWP_REQ]: lowest %d highest %d desired %d epp %d window 0x%x (%d*10^%dus) use_pkg %d\n",
+			h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
+			h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7, h->hwp_use_pkg);
 
-	printf("HWP_REQ: min %d max %d des %d epp %d window 0x%x (%d*10^%dus) use_pkg %d\n",
-		h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
-		h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7, h->hwp_use_pkg);
 }
 void print_hwp_request_pkg(int pkg, struct msr_hwp_request *h, char *str)
 {
@@ -876,9 +881,15 @@  void print_hwp_request_pkg(int pkg, struct msr_hwp_request *h, char *str)
 	if (str)
 		printf("%s", str);
 
-	printf("HWP_REQ_PKG: min %d max %d des %d epp %d window 0x%x (%d*10^%dus)\n",
-		h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
-		h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7);
+	if (genuine_intel) {
+		printf("HWP_REQ_PKG: min %d max %d des %d epp %d window 0x%x (%d*10^%dus)\n",
+			h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
+			h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7);
+	} else if (authentic_amd) {
+		printf("AMD HWP_REQ_PKG: lowest %d highest %d desired %d epp %d window 0x%x (%d*10^%dus)\n",
+			h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp,
+			h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7);
+	}
 }
 void read_hwp_request(int cpu, struct msr_hwp_request *hwp_req, unsigned int msr_offset)
 {