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

From: Chen Yu
Date: Tue May 04 2021 - 23:05:03 EST


On Tue, May 04, 2021 at 06:56:00PM -0400, Len Brown wrote:
> 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.
>
Okay. BTW it looks like the following patch has already fixed the _CST format issue
and single tab still works:
commit fecb3bc839df64761cc63c9ee9b45c1cad36aee8
Author: David Arcari <darcari@xxxxxxxxxx>
Date: Mon Aug 10 10:43:30 2020 -0400

tools/power turbostat: Fix output formatting for ACPI CST enumeration

thanks,
Chenyu