From patchwork Wed Mar 1 05:27:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9597715 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 4A37460414 for ; Wed, 1 Mar 2017 07:14:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B5A4284EF for ; Wed, 1 Mar 2017 07:14:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FD82284F5; Wed, 1 Mar 2017 07:14:41 +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=ham 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 CEF8B284EF for ; Wed, 1 Mar 2017 07:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751955AbdCAHOj (ORCPT ); Wed, 1 Mar 2017 02:14:39 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:36126 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbdCAHOf (ORCPT ); Wed, 1 Mar 2017 02:14:35 -0500 Received: by mail-qk0-f196.google.com with SMTP id u188so8600625qkc.3; Tue, 28 Feb 2017 23:14:35 -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=n1gRuM1dj/klcGHOOnul63gaA3oNZgEVzzuR3XfekjY=; b=rDwZ3j2JvROoz/hOWl9mtHVJr4/TJ48DtjalIAvO4JFjyJqcUWyHrStS4Du5tp4OOP 4ucrQSn7pTbjUQ11PGBO8cL7n7Gg2BAp9n0XgOQh9d6mw7bFUpuS1APUbSWaT/JJMDzq o3+29VjDgGyJ5D2rBWR2qL6q+/49MV4UEk9erG6OKBVa2ok8MM/0JO4avpfHkZIsw/aS IPnxoKPxRNALZnmTq3g9MXwOflwK5fMQCgT1UAAatEa5ejUMaWB0oJHV0F1Qqpu1bdjn VKTah/qVQlWyGzsRONwkssKWMxtFMzw8EsZ/Xh7VaqJslzHNojW7ytoJ/tn5UqolKbm+ +uow== 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=n1gRuM1dj/klcGHOOnul63gaA3oNZgEVzzuR3XfekjY=; b=MPukEZcvhrsKg7PDWZlkVG0tFhUhgw856FUU2VMnvqYLgIEbyrRmRUBXQVP5LVsMXi z+VGEmTTTm5GS4vjrCfK0pyM8xKtIY2LBr6QwgWUl+WCXyKBmRKBgFdBajvZFi2yJtDP O07hii3+zVHJn5I48AMG6+JA4Xa6sG2EjlVO32Cp6W1NBInt8JLsdNB8HlMTomBGPszH q4kzcb9hGANmZT95VRmFnT9krcOH+Ii/BsM5+kBDZ5K4WbDOf6xLB/4JBiN830Hjzk7A M+8IvjsNlQDsOjAA4zAzBpH+/3pvXmF+yLSRhXz+RzmusUi/Gw2JZQ5w33agBE7e1/pI R6Fw== X-Gm-Message-State: AMke39mNHmlb6lwwI1GJxrxCJGV3vCFvVZZ5o1FONPb0ZLfLdNrksmlbqzuBkbFSNFsuJA== X-Received: by 10.200.47.208 with SMTP id m16mr7526226qta.103.1488346125515; Tue, 28 Feb 2017 21:28:45 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Feb 2017 21:28:45 -0800 (PST) From: Len Brown To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 33/44] tools/power turbostat: fix zero IRQ count shown in one-shot command mode Date: Wed, 1 Mar 2017 00:27:37 -0500 Message-Id: <218f0e8d5c388767be9c78fd2c5bc0a6f416d6d0.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 The IRQ column has been working for periodic mode, but not in one-shot command mode, it shows only 0. until now. Signed-off-by: Len Brown --- tools/power/x86/turbostat/turbostat.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 8c965bb2f461..48b540a2fe81 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -619,9 +619,9 @@ int dump_counters(struct thread_data *t, struct core_data *c, outp += sprintf(outp, "c1: %016llX\n", t->c1); if (DO_BIC(BIC_IRQ)) - outp += sprintf(outp, "IRQ: %08X\n", t->irq_count); + outp += sprintf(outp, "IRQ: %d\n", t->irq_count); if (DO_BIC(BIC_SMI)) - outp += sprintf(outp, "SMI: %08X\n", t->smi_count); + outp += sprintf(outp, "SMI: %d\n", t->smi_count); for (i = 0, mp = sys.tp; mp; i++, mp = mp->next) { outp += sprintf(outp, "tADDED [%d] msr0x%x: %08llX\n", @@ -2410,8 +2410,9 @@ int snapshot_gfx_mhz(void) */ int snapshot_proc_sysfs_files(void) { - if (snapshot_proc_interrupts()) - return 1; + if (DO_BIC(BIC_IRQ)) + if (snapshot_proc_interrupts()) + return 1; if (DO_BIC(BIC_GFX_rc6)) snapshot_gfx_rc6_ms(); @@ -4391,6 +4392,7 @@ int fork_it(char **argv) pid_t child_pid; int status; + snapshot_proc_sysfs_files(); status = for_all_cpus(get_counters, EVEN_COUNTERS); if (status) exit(status); @@ -4417,6 +4419,7 @@ int fork_it(char **argv) * n.b. fork_it() does not check for errors from for_all_cpus() * because re-starting is problematic when forking */ + snapshot_proc_sysfs_files(); for_all_cpus(get_counters, ODD_COUNTERS); gettimeofday(&tv_odd, (struct timezone *)NULL); timersub(&tv_odd, &tv_even, &tv_delta); @@ -4438,6 +4441,7 @@ int get_and_dump_counters(void) { int status; + snapshot_proc_sysfs_files(); status = for_all_cpus(get_counters, ODD_COUNTERS); if (status) return status;