Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1100817ybe; Fri, 6 Sep 2019 11:52:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLaR9URUDrvhvbBgAqky4yQf9GTxvxqGicv9Tav4yYp6uHg4AjdXq3llDbP5QIyFhKwzCu X-Received: by 2002:a05:6a00:8c:: with SMTP id c12mr12027983pfj.200.1567795935533; Fri, 06 Sep 2019 11:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567795935; cv=none; d=google.com; s=arc-20160816; b=et1xlvtXDKgUBsvS0QNAZNKyyv4cTw/NDA+nmuiAr/SNdVJeQDTUnOQwfRP5FqkZ5A bY4kDe+k9xbXRaWNcveWBVsBv/qTqm0+H3qEKxCh3MZdq8Mswp22NwNaqoZ0FMLPEAsC 8SYIPb6x+5jsefVd9Zc712+KQCAvBm52+Je/dV7lXLRn5lit4ajQ8CaTsidzJbIrmH4i TuDyJB4R/OHFAIcWR2sLxt4cVxjIdNRF8lw08sZEN9Pd/ZXzUNx+Jqt88/NXRDSY0DXx P+/FEXQV6ijlndjpCBZzKOYThjVHx/bwFnC0qgKQCBbpfdsSIyAeNx0mVRy71t7YaGLy qUAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nexudQmOaTrndo1IrygTN1807YQqMbTsA89zt3fi2ZI=; b=NpzLIHdMXALVaHZpQuoJEzoxS70TxueUtuXG/tdDrBvij16FA77Ha2UlBhniHz1XSE 7XW3O1+yvJoCnCSRHenWTNBa96pRiG2+wcphja5vbyzaa9K8vsxpcpt3XwqCJido04s0 6E9WRmropRAr7D79yxZ0rlp75GhcauMxUDp0WyFYaS62z/jN7p/NKi2zCA4Ie2yYmeTF 2GWlUxV9JOZK9vGetzbMpT84vBApa8dSM5uSza2urgmrHXlnCYwKA3oBRZtxHJyRiuTa WeSCyyTA0nHFSN7PBgd19ZZRVCccr9ZA7wF+fNax6Eua4F7+NvA+h8LI1CK8pSSA86q1 NrHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc10si4677768plb.171.2019.09.06.11.52.00; Fri, 06 Sep 2019 11:52:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403970AbfIFNrA (ORCPT + 99 others); Fri, 6 Sep 2019 09:47:00 -0400 Received: from mga02.intel.com ([134.134.136.20]:59301 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393462AbfIFNq7 (ORCPT ); Fri, 6 Sep 2019 09:46:59 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2019 06:46:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,473,1559545200"; d="scan'208";a="334895571" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004.jf.intel.com with ESMTP; 06 Sep 2019 06:46:56 -0700 Received: from andy by smile with local (Exim 4.92.1) (envelope-from ) id 1i6EZj-0007Jg-Qq; Fri, 06 Sep 2019 16:46:55 +0300 Date: Fri, 6 Sep 2019 16:46:55 +0300 From: Andy Shevchenko To: Prarit Bhargava Cc: Srinivas Pandruvada , darcari@redhat.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH 2/2] tools/power/x86/intel-speed-select: Display core count for bucket Message-ID: <20190906134655.GU2680@smile.fi.intel.com> References: <20190905233748.6822-1-srinivas.pandruvada@linux.intel.com> <20190905233748.6822-2-srinivas.pandruvada@linux.intel.com> <780a3faf-9e44-64f4-a354-bdee39af3af5@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <780a3faf-9e44-64f4-a354-bdee39af3af5@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 05:39:54AM -0400, Prarit Bhargava wrote: > On 9/5/19 7:37 PM, Srinivas Pandruvada wrote: > > Read the bucket and core count relationship via MSR and display > > when displaying turbo ratio limits. > > + ret = isst_send_msr_command(cpu, 0x1ae, 0, buckets_info); > > ^^^ you can get rid of the magic number 0x1ae by doing (sorry for the cut-and-paste) > > diff --git a/tools/power/x86/intel-speed-select/Makefile b/tools/power/x86/intel > index 12c6939dca2a..087d802ad844 100644 > --- a/tools/power/x86/intel-speed-select/Makefile > +++ b/tools/power/x86/intel-speed-select/Makefile > @@ -15,6 +15,8 @@ endif > MAKEFLAGS += -r > > override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include > +override CFLAGS += -I../../../include > +override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' I guess it can be done in more neat way. > As I've been looking at this code I have been wondering why didn't you just use > the standard /dev/cpu/X/msr interface that other x86 power utilities (turbostat, > x86_energy_perf_policy) use? Implementing msr_read() is trivial (warning > untested and uncompiled code) Actually good point! -- With Best Regards, Andy Shevchenko