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

Re: [PATCH v7 08/15] xenpm: Change get-cpufreq-para output for hwp


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 27 Jul 2023 12:00:54 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Thu, 27 Jul 2023 11:01:19 +0000
  • Ironport-data: A9a23:/rhnLa8T0TBziq5ZDb8uDrUDqX6TJUtcMsCJ2f8bNWPcYEJGY0x3m mYYC2vXM/7Zajege41/YYiz9hsDuMDTxtRiHApq+C08E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ird7ks21BjOkGlA5AdmOqoU5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDkkSr KwgOQ0cVSuuvMuc3O3lQeVK1oc8eZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUqGOkcUUrsUIMtWcOOAj3/jczpeuRSNqLA++WT7xw1tyrn9dtHSf7RmQO0MxxjD/ DmapzyR7hcyEteGwgW543KX3ayUrDjlY6MqCaSD36s/6LGU7jNKU0BHPbehmtG7g0iyQcNCK GQb/yMvqe4580nDZsnwWVi0rWCJujYYWsFMCKsq5QeV0K3W7g2FQG8eQVZpd9gOpMIwAzsw2 TehndnkGDhuu729Um+G+/GfqjbaESENIHULfyMsUQoP6N6lq4Y25i8jVf46TvTz1IesX2itn XbT9nNWa6gvYdAji/zrxUH6kgmXi6PgZBJquA7beDLm8VYsDGK6XLBE+WQ3/N4ZctfBFQja7 CBY8ySNxLtQVM/QzURhVM1IRej0vKjdbVUwlHY1R/EcGyKRF2lPlGy6yBV3Pw9XP8kNYlcFi 2eD6FoKtPe/0JZHBJKbgr5d6Oxwl8AM7fy/CpjpgiNmO/CdjjOv8iB0flK31GvwikUqmqxXE c7FIJ73XChAVvU8lGXeqwIhPVkDnH5WKYT7HM6T8vha+eDGOC79pUktbjNikdzVHIvb+V6Io r6zxuOByglFUf2WX8Uk2dd7ELz+FlBiXcqeg5UOJoa+zv9ORDlJ5wn5nelwJOSIXs19yo/1w 51KchYHkwGi1CKfcl7ih7IKQOqHYKuTZEkTZUQEVWtEEVB+CWpzxM/zr6cKQIQ=
  • Ironport-hdrordr: A9a23:yTOIVKj/wTYD0InFEUPxHn5YCHBQXvoji2hC6mlwRA09TyX4rb HNoB1/73XJYVkqNU3I9ertBED4ewK5yXcX2/hzAV7BZmjbUQKTRelfBO3ZrAEIcBefygcy78 ldmp9FebjN5AhB5voSODPIaOrIGuP3iZxAWN2uqEuFkTsaE52IMT0JcDpyfSVNNW97OaY=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jul 26, 2023 at 01:09:38PM -0400, Jason Andryuk wrote:
> diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
> index 1c474c3b59..21c93386de 100644
> --- a/tools/misc/xenpm.c
> +++ b/tools/misc/xenpm.c
> @@ -711,6 +711,7 @@ void start_gather_func(int argc, char *argv[])
>  /* 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;
>      int i;
>  
>      printf("cpu id               : %d\n", cpuid);
> @@ -720,49 +721,57 @@ 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 )

This test kind of feels wrong. Should we test instead the thing we want
to print? Maybe declaring another bool, something like "bool
scaling_governor = !hwp" just below the declaration of "bool hwp"?
Otherwise, if there's another technology that comes along that isn't
"hwp" and not something that can be printed with this, there's going to
be some kind of hidden bug (even if probably easy to spot during
development).

>      {
> +        printf("scaling_avail_gov    : %s\n",
> +               p_cpufreq->scaling_available_governors);


Thanks,

-- 
Anthony PERARD



 


Rackspace

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