From patchwork Sun Oct 7 02:43:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 1560321 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 166F5E00DD for ; Sun, 7 Oct 2012 02:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752679Ab2JGCnt (ORCPT ); Sat, 6 Oct 2012 22:43:49 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:35064 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886Ab2JGCnr (ORCPT ); Sat, 6 Oct 2012 22:43:47 -0400 Received: by mail-qa0-f53.google.com with SMTP id s11so1215935qaa.19 for ; Sat, 06 Oct 2012 19:43:46 -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=SgKWf4vpyxGK6Jod1Q6vL6PlceiysGV7z3VdiuRwgA4=; b=w+kcbN7o3fc1OIO5x24ZeHQn/WvpRx73prLHux9V7lv6AJgEitiwBvej+IhFw6QuG2 kdegctBlOS/sIjN9Llx16abrYtbe3KGRRe28482RVm2czcOndh33o7VoWujqLflV0UMe KssNeZMghLxDjdSQz64X8qgOeQHX7Z9QN8iUPEP73xrkpEEG5zp6NFfmWUM767bjq0tI 6u/t9u53haHrjVRNkRRF33t2eXXqCYsZaIRJ5UOohVZOWOi2wJWY1bkkHH9ytiu+GPud nxVWK2cxRh9qQkVRbI6+lYG+7FrqZt1ouXRwz2MQlXxTXhps+VBJz0w/ZgEIf8vv3qWQ ZtdA== Received: by 10.224.183.146 with SMTP id cg18mr23629056qab.7.1349577826599; Sat, 06 Oct 2012 19:43:46 -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.43.37 (version=SSLv3 cipher=OTHER); Sat, 06 Oct 2012 19:43:38 -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 43/49] tools/power turbostat: make -M output pretty Date: Sat, 6 Oct 2012 22:43:13 -0400 Message-Id: <130ff304f6d31484fc73bb337bc635cba1ffe04c.1349554106.git.len.brown@intel.com> 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 The -M option dumps the specified 64-bit MSR with every sample. Previously it was output at the end of each line. However, with the v2 style of printing, the lines are now staggered, making MSR output hard to read. So move the MSR output column to the left where things are aligned. Signed-off-by: Len Brown --- tools/power/x86/turbostat/turbostat.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 5db4add..5ce88dd 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -223,6 +223,8 @@ void print_header(void) if (has_aperf) outp += sprintf(outp, " GHz"); outp += sprintf(outp, " TSC"); + if (extra_msr_offset) + outp += sprintf(outp, " MSR 0x%04X", extra_msr_offset); if (do_nhm_cstates) outp += sprintf(outp, " %%c1"); if (do_nhm_cstates) @@ -239,8 +241,6 @@ void print_header(void) outp += sprintf(outp, " %%pc6"); if (do_snb_cstates) outp += sprintf(outp, " %%pc7"); - if (extra_msr_offset) - outp += sprintf(outp, " MSR 0x%x ", extra_msr_offset); outp += sprintf(outp, "\n"); } @@ -361,6 +361,10 @@ int format_counters(struct thread_data *t, struct core_data *c, /* TSC */ outp += sprintf(outp, "%5.2f", 1.0 * t->tsc/units/interval_float); + /* MSR */ + if (extra_msr_offset) + outp += sprintf(outp, " 0x%016llx", t->extra_msr); + if (do_nhm_cstates) { if (!skip_c1) outp += sprintf(outp, " %6.2f", 100.0 * t->c1/t->tsc); @@ -392,8 +396,6 @@ int format_counters(struct thread_data *t, struct core_data *c, if (do_snb_cstates) outp += sprintf(outp, " %6.2f", 100.0 * p->pc7/t->tsc); done: - if (extra_msr_offset) - outp += sprintf(outp, " 0x%016llx", t->extra_msr); outp += sprintf(outp, "\n"); return 0;