From patchwork Wed Mar 1 05:27:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9597605 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D612C600CB for ; Wed, 1 Mar 2017 05:40:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C869B26E56 for ; Wed, 1 Mar 2017 05:40:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB38328428; Wed, 1 Mar 2017 05:40:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2725326E56 for ; Wed, 1 Mar 2017 05:40:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752216AbdCAFkW (ORCPT ); Wed, 1 Mar 2017 00:40:22 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33403 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752024AbdCAFkR (ORCPT ); Wed, 1 Mar 2017 00:40:17 -0500 Received: by mail-qk0-f193.google.com with SMTP id n186so8207710qkb.0; Tue, 28 Feb 2017 21:37:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:reply-to:organization; bh=5xqJwJHQ1kUmrv+jgv8zIDnMS8KOIGqmeIqNaloTVbg=; b=euExqRyECfyrIZI9iMBLczZrjDDNHla4BQqwxbnpr3sVImDadpFqFTgO6ipsTUBggV t+HaUKwm8NG2ptf3BSh38Wkj9+yuRUyU5wrFv6u92ZS1HIOPe2h9z1/kgKWcf5N/EVfg I/j7SI8Fid50/JcZWw1aud9F+4B9eyXWnGhDaaiuNFJubPd4Q0wJhsvi0dztBEMnF2yC vYACOAo5X8Z+WdLs7o8GFw/+IVUg06hCkUuS724xDhdiqSrvn0UF4YraesJ6WFmnJjlO tkT3ddTQOGTUXzy6hUgoSIajSQAgJnFQ4/kiS9Ls22FfgInPHUbpnh7nuhMkTqITgLmp rDBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:reply-to:organization; bh=5xqJwJHQ1kUmrv+jgv8zIDnMS8KOIGqmeIqNaloTVbg=; b=bbgjjWXvrLtrKlk+xls5+of9AiheRoivaRYHn6wAk7/PRV4B8jf/urdW9DxdAtVTzy Gq3Y99iWFglRWLUt/65GjRBGeSZ8VWbEYBjZt1MaeTGYgdPQZh+KY2+Yt6AkaRnl7NlD uULHYg1UsmARGsFjNvhaw+O7+xTlCg1sNGXfBUSbg3SOQQkSOK4H5BTh4FVStY4gKqV4 qxuuzH0VapFL+RPvgTt5/wtwzbTlMwk50so+OMBEPvTVZzX3V42vaG1SEZbccmViFMQl 7RqdPK72K23jEzMKR9OFYJp3IP9Lm3TpBX8yf4eny/CWgVUahRgDOJNxx3+UGvVmeelc qm7Q== X-Gm-Message-State: AMke39lDcaGC5O6jqktFczkhZvg2WeXqNj9+fzcRqhEi3Jp3dnpmInxBIohBc5F3Vx/mhg== X-Received: by 10.55.214.141 with SMTP id p13mr7541523qkl.119.1488346130979; Tue, 28 Feb 2017 21:28:50 -0800 (PST) Received: from z87.localdomain (pool-96-230-116-151.bstnma.fios.verizon.net. [96.230.116.151]) by smtp.gmail.com with ESMTPSA id c141sm2530517qkb.10.2017.02.28.21.28.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Feb 2017 21:28:50 -0800 (PST) From: Len Brown To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 41/44] tools/power turbostat: dump p-state software config Date: Wed, 1 Mar 2017 00:27:45 -0500 Message-Id: <7293fccdffdec0ab0c36c4e4cffacb3ff114928e.1488345270.git.len.brown@intel.com> X-Mailer: git-send-email 2.11.0.161.g6610af872 In-Reply-To: <20170301052748.27810-1-lenb@kernel.org> References: <20170301052748.27810-1-lenb@kernel.org> In-Reply-To: <678a3bd1b3de6d2ebf604e7d708bc8150bb667e9.1488345270.git.len.brown@intel.com> References: <678a3bd1b3de6d2ebf604e7d708bc8150bb667e9.1488345270.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Len Brown cpu1: cpufreq driver: acpi-cpufreq cpu1: cpufreq governor: ondemand cpufreq boost: 1 or cpu0: cpufreq driver: intel_pstate cpu0: cpufreq governor: powersave cpufreq intel_pstate no_turbo: 0 Signed-off-by: Len Brown --- tools/power/x86/turbostat/turbostat.c | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 2c674ad5ab80..7af5f42a9792 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -2979,6 +2979,54 @@ dump_sysfs_cstate_config(void) fclose(input); } } +static void +dump_sysfs_pstate_config(void) +{ + char path[64]; + char driver_buf[64]; + char governor_buf[64]; + FILE *input; + int turbo; + + sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_driver", + base_cpu); + input = fopen(path, "r"); + if (input == NULL) { + fprintf(stderr, "NSFOD %s\n", path); + return; + } + fgets(driver_buf, sizeof(driver_buf), input); + fclose(input); + + sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor", + base_cpu); + input = fopen(path, "r"); + if (input == NULL) { + fprintf(stderr, "NSFOD %s\n", path); + return; + } + fgets(governor_buf, sizeof(governor_buf), input); + fclose(input); + + fprintf(outf, "cpu%d: cpufreq driver: %s", base_cpu, driver_buf); + fprintf(outf, "cpu%d: cpufreq governor: %s", base_cpu, governor_buf); + + sprintf(path, "/sys/devices/system/cpu/cpufreq/boost"); + input = fopen(path, "r"); + if (input != NULL) { + fscanf(input, "%d", &turbo); + fprintf(outf, "cpufreq boost: %d\n", turbo); + fclose(input); + } + + sprintf(path, "/sys/devices/system/cpu/intel_pstate/no_turbo"); + input = fopen(path, "r"); + if (input != NULL) { + fscanf(input, "%d", &turbo); + fprintf(outf, "cpufreq intel_pstate no_turbo: %d\n", turbo); + fclose(input); + } +} /* @@ -4168,6 +4216,8 @@ void process_cpuid() if (!quiet) dump_sysfs_cstate_config(); + if (!quiet) + dump_sysfs_pstate_config(); if (has_skl_msrs(family, model)) calculate_tsc_tweak();