Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3086210pxa; Tue, 18 Aug 2020 06:21:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWfU0CIiXS6eiX4P3x2Lb8mH5pHOfjZrEb8PVYN0Nj2Fj7h9XUmBNrSSTXl/NWMa1HolR8 X-Received: by 2002:a50:9d8a:: with SMTP id w10mr19255699ede.16.1597756894658; Tue, 18 Aug 2020 06:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597756894; cv=none; d=google.com; s=arc-20160816; b=sQE7fyuz6eom42YDKF+Q9r2IPKtJcN+vU1JYuiYv+q6LgRmAJySEs+9uFSAGiW/lmP npfWP8/3Cgwg31QrcgpLenx/R8XOOsoYEPiQ8Gb5xr2kG27NrOdE2zpZRj//eUWUw3u/ i2CuSN43Df6I9U6+WLH4H64ew54RV7QfE+uYMvd+BqSfyJ/NWVWCMhpdbULdCOHgLdK8 ZoY8ZqAOgUOmIWyNEmDfalK9Fs5oU8bvE2SR9RaSPhNxZtH9jXJYAZDLmpocIuXQ5P6I 0J2SNvTI6FLQkpSX6iLEnkdenw6wNGdfuapO2LgkHofmRFaLXIc/B51sy4T23yBCmNcK JsWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=F0uI96kuUyz81rQQhwBKLrJwcZelZomkWIsH60DHRcU=; b=xkw57XphSkbAjdqbJ2wDfW+128/ks6fegL7fzVFc6cIZSPBsoIcbdAmIr2pebFwz8Y rGHt2mN6lzdCoJKB68etB6uufXZbdDBAWi7UzONHHIsEYCsap8goDLIOF1G1n4/pz41L Mr+tMOujySnkvIAvxZ3Dczp2HfjpsaCprPt9ihqrbLFRxTqPH6zeI+lHJk6S+MvGwLNl A6QHqQFL/VrNQy7TrhNSSaOSFHt1MhYk5nmg7C3e7jm/YV1T5e/6Frdwj+c+XWFGLzxQ 6uNbtS/IkMp+hMnfF2TaaOQFpSOLXAQn4XCLVnnLFUJVQT06sqOPVYiaXmd0JYycoj5v pvEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MMIVJnuN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u20si12814443edq.501.2020.08.18.06.21.09; Tue, 18 Aug 2020 06:21:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MMIVJnuN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726480AbgHRNR4 (ORCPT + 99 others); Tue, 18 Aug 2020 09:17:56 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:44810 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726353AbgHRNRz (ORCPT ); Tue, 18 Aug 2020 09:17:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597756673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F0uI96kuUyz81rQQhwBKLrJwcZelZomkWIsH60DHRcU=; b=MMIVJnuNUQJVYMP0Yu7s2CzYFJnWphHJOTq1F+xGcL8HR3LyhLqzF40168jRg94dWq7Qzp U6ynYPaZE4rb3i+gk/UgVes/55EWrHXGlqwqDzXwd4NhH5oz3bcLF/3CMhG2kd1LV2GJhT nXpRmnuneyafP/RIUBhT/YdAa9Uwae4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-414-6tH6VciYN8G9RuEwLPJ1Eg-1; Tue, 18 Aug 2020 09:17:51 -0400 X-MC-Unique: 6tH6VciYN8G9RuEwLPJ1Eg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EDC58100CECC; Tue, 18 Aug 2020 13:17:49 +0000 (UTC) Received: from darcari.bos.csb (ovpn-114-148.rdu2.redhat.com [10.10.114.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93E9426327; Tue, 18 Aug 2020 13:17:49 +0000 (UTC) Subject: Re: [PATCH] tools/power turbostat: fix output formatting for ACPI CST enumeration To: linux-pm@vger.kernel.org Cc: Len Brown , linux-kernel@vger.kernel.org References: <20200810144330.75613-1-darcari@redhat.com> From: David Arcari Organization: Red Hat Message-ID: Date: Tue, 18 Aug 2020 09:17:49 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200810144330.75613-1-darcari@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Just want to make sure that this doesn't get lost. Please let me know if you feel there is a better approach. Thanks, -Dave On 8/10/20 10:43 AM, David Arcari wrote: > turbostat formatting is broken with ACPI CST for enumeration. The > problem is that the CX_ACPI% is eight characters long which does not > work with tab formatting. One simple solution is to remove the underbar > from the state name such that C1_ACPI will be displayed as C1ACPI. > > Signed-off-by: David Arcari > Cc: Len Brown > Cc: linux-kernel@vger.kernel.org > --- > tools/power/x86/turbostat/turbostat.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c > index 33b370865d16..5f074879cc0a 100644 > --- a/tools/power/x86/turbostat/turbostat.c > +++ b/tools/power/x86/turbostat/turbostat.c > @@ -3474,6 +3474,20 @@ int has_config_tdp(unsigned int family, unsigned int model) > } > } > > +static void > +remove_underbar(char *s) > +{ > + char *to = s; > + > + while (*s) { > + if (*s != '_') > + *to++ = *s; > + s++; > + } > + > + *to = 0; > +} > + > static void > dump_cstate_pstate_config_info(unsigned int family, unsigned int model) > { > @@ -3559,6 +3573,8 @@ dump_sysfs_cstate_config(void) > *sp = '\0'; > fclose(input); > > + remove_underbar(name_buf); > + > sprintf(path, "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/desc", > base_cpu, state); > input = fopen(path, "r"); > @@ -5597,6 +5613,8 @@ void probe_sysfs(void) > *sp = '%'; > *(sp + 1) = '\0'; > > + remove_underbar(name_buf); > + > fclose(input); > > sprintf(path, "cpuidle/state%d/time", state); > @@ -5624,6 +5642,8 @@ void probe_sysfs(void) > *sp = '\0'; > fclose(input); > > + remove_underbar(name_buf); > + > sprintf(path, "cpuidle/state%d/usage", state); > > if (is_deferred_skip(name_buf)) >