Re: [PATCH][RFC] tools/power turbostat: Fix ACPI CState format issue

From: Len Brown
Date: Tue May 04 2021 - 18:56:22 EST


On Mon, Oct 12, 2020 at 6:00 AM Chen Yu <yu.c.chen@xxxxxxxxx> wrote:
>
> Currently if the system boots with BIOS _CST Cstate information
> enabled, the turbostat output would have unaligned problems:
>
> C1_ACPI C2_ACPI C3_ACPI POLL% C1_ACPI% C2_ACPI% C3_ACPI% CPU%c1
> 5 37 138 0.00 0.02 1.30 98.51 0.38 0.00 0.00 99.43
>
> The C1_ACPI% is of 8 bytes, so extend the format accordingly if the field name
> equals to/longer than 8 bytes.
>
> After the patch applied:
>
> C1_ACPI C2_ACPI C3_ACPI POLL% C1_ACPI% C2_ACPI% C3_ACPI% CPU%c1
> 2 42 96 0.00 0.12 2.60 97.09 0.60

Let's shorten the header fields so that a single tab continues to work.
this is helpful for processing turbostat output in .TSV format.

thx