From patchwork Sun Oct 7 02:43:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 1560381 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 29327DFE80 for ; Sun, 7 Oct 2012 02:44:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753079Ab2JGCob (ORCPT ); Sat, 6 Oct 2012 22:44:31 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:63438 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753048Ab2JGCo2 (ORCPT ); Sat, 6 Oct 2012 22:44:28 -0400 Received: by mail-qa0-f46.google.com with SMTP id c26so1348556qad.19 for ; Sat, 06 Oct 2012 19:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:reply-to:organization; bh=b4V/ETi75ZMnpsH7qjT3zlK2H1qHPCYg1tLbfKrgfSU=; b=bLDQRrdWFfCSjoIEBOCkbP2Bz1xfls78MquQHl/jLhlnz6WEZlmJ8hbwBmtO+SVT7u DD9VyTuohcrZ+f1hFMVJbI1tdNuhpEV4/rI34eQpaKKPwH+WWqk4kYJnuVn1bYisamfu 3e89iLfDsEHxD2XmmfkdMqLkYkH4SO+SYbfGzPrsIN6eNMR+D0MIX60FbQ2LkYlX8AEo k13ff+g3rGmaxA8Gv6BeRw5JEcBRaz2vjxJMHvcFKRafuZ2cYC6TD3KBZy6w0FYZxZBW nQyQx6fPxKhjZRP+PVG88wSW8AA/JCdZfFynzh93cl9ACx2oAKxo1cDYnktS75f3RmWu PBTQ== Received: by 10.224.180.83 with SMTP id bt19mr24125774qab.82.1349577867125; Sat, 06 Oct 2012 19:44:27 -0700 (PDT) Received: from x980.localdomain6 (pool-74-104-146-186.bstnma.fios.verizon.net. [74.104.146.186]) by mx.google.com with ESMTPS id g18sm14309050qan.1.2012.10.06.19.44.04 (version=SSLv3 cipher=OTHER); Sat, 06 Oct 2012 19:44:19 -0700 (PDT) From: Len Brown To: linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 47/49] tools/power/turbostat: add option to count SMIs, re-name some options Date: Sat, 6 Oct 2012 22:43:17 -0400 Message-Id: X-Mailer: git-send-email 1.8.0.rc0.18.gf84667d In-Reply-To: <1349577799-566-1-git-send-email-lenb@kernel.org> References: <1349577799-566-1-git-send-email-lenb@kernel.org> In-Reply-To: References: Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Len Brown Counting SMIs is popular, so add a dedicated "-s" option to do it, and juggle some of the other option letters. -S is now system summary (was -s) -c is 32 bit counter (was -d) -C is 64-bit counter (was -D) -p is 1st thread in core (was -c) -P is 1st thread in package (was -p) bump the minor version number Signed-off-by: Len Brown --- tools/power/x86/turbostat/turbostat.8 | 12 +++++++----- tools/power/x86/turbostat/turbostat.c | 23 +++++++++++++---------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8 index 0fc7a11..e4d0690 100644 --- a/tools/power/x86/turbostat/turbostat.8 +++ b/tools/power/x86/turbostat/turbostat.8 @@ -23,17 +23,19 @@ supports an "invariant" TSC, plus the APERF and MPERF MSRs. on processors that additionally support C-state residency counters. .SS Options -The \fB-s\fP option limits output to a 1-line system summary for each interval. +The \fB-p\fP option limits output to the 1st thread in 1st core of each package. .PP -The \fB-c\fP option limits output to the 1st thread in each core. +The \fB-P\fP option limits output to the 1st thread in each Package. .PP -The \fB-p\fP option limits output to the 1st thread in each package. +The \fB-S\fP option limits output to a 1-line System Summary for each interval. .PP The \fB-v\fP option increases verbosity. .PP -The \fB-d MSR#\fP option includes the delta of the specified 32-bit MSR counter. +The \fB-s\fP option prints the SMI counter, equivalent to "-c 0x34" .PP -The \fB-D MSR#\fP option includes the delta of the specified 64-bit MSR counter. +The \fB-c MSR#\fP option includes the delta of the specified 32-bit MSR counter. +.PP +The \fB-C MSR#\fP option includes the delta of the specified 64-bit MSR counter. .PP The \fB-m MSR#\fP option includes the the specified 32-bit MSR value. .PP diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index e38976c..2655ae9 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -230,9 +230,9 @@ void print_header(void) outp += sprintf(outp, " GHz"); outp += sprintf(outp, " TSC"); if (extra_delta_offset32) - outp += sprintf(outp, " delta 0x%03X", extra_delta_offset32); + outp += sprintf(outp, " count 0x%03X", extra_delta_offset32); if (extra_delta_offset64) - outp += sprintf(outp, " DELTA 0x%03X", extra_delta_offset64); + outp += sprintf(outp, " COUNT 0x%03X", extra_delta_offset64); if (extra_msr_offset32) outp += sprintf(outp, " MSR 0x%03X", extra_msr_offset32); if (extra_msr_offset64) @@ -1304,7 +1304,7 @@ void check_cpuid() void usage() { - fprintf(stderr, "%s: [-v][-d MSR#][-D MSR#][-m MSR#][-M MSR#][-i interval_sec | command ...]\n", + fprintf(stderr, "%s: [-v][-p|-P|-S][-c MSR# | -s]][-C MSR#][-m MSR#][-M MSR#][-i interval_sec | command ...]\n", progname); exit(1); } @@ -1594,15 +1594,15 @@ void cmdline(int argc, char **argv) progname = argv[0]; - while ((opt = getopt(argc, argv, "+cpsvid:D:m:M:")) != -1) { + while ((opt = getopt(argc, argv, "+pPSvisc:sC:m:M:")) != -1) { switch (opt) { - case 'c': + case 'p': show_core_only++; break; - case 'p': + case 'P': show_pkg_only++; break; - case 's': + case 'S': summary_only++; break; case 'v': @@ -1611,10 +1611,13 @@ void cmdline(int argc, char **argv) case 'i': interval_sec = atoi(optarg); break; - case 'd': + case 'c': sscanf(optarg, "%x", &extra_delta_offset32); break; - case 'D': + case 's': + extra_delta_offset32 = 0x34; /* SMI counter */ + break; + case 'C': sscanf(optarg, "%x", &extra_delta_offset64); break; case 'm': @@ -1634,7 +1637,7 @@ int main(int argc, char **argv) cmdline(argc, argv); if (verbose > 1) - fprintf(stderr, "turbostat v2.0 May 16, 2012" + fprintf(stderr, "turbostat v2.1 October 6, 2012" " - Len Brown \n"); turbostat_init();