From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756900AbdJLMNQ (ORCPT ); Thu, 12 Oct 2017 08:13:16 -0400 Received: from mga06.intel.com ([134.134.136.31]:61887 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbdJLMNN (ORCPT ); Thu, 12 Oct 2017 08:13:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,366,1503385200"; d="scan'208";a="1205049032" Subject: Re: [PATCH] perf stat: Support metrics with perf stat --per-thread To: Jiri Olsa Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com References: <1507799100-2667-1-git-send-email-yao.jin@linux.intel.com> <20171012113019.GA4872@krava> From: "Jin, Yao" Message-ID: <002d04ce-72a5-4a8f-30c2-ec1bcfd08358@linux.intel.com> Date: Thu, 12 Oct 2017 20:13:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171012113019.GA4872@krava> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > I wonder if patch below would be enough for this > > jirka > > Hi Jiri, I think below patch and next patch (in your another mail) is OK, thanks! Do I need to upgrade my patch to v2 according to your modifications? Or you will post your patches? Both OK for me. :) Thanks Jin Yao > --- > diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c > index 35e9848734d6..56a0a36d0653 100644 > --- a/tools/perf/util/stat.c > +++ b/tools/perf/util/stat.c > @@ -259,6 +259,7 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel > struct perf_counts_values *aggr = &evsel->counts->aggr; > static struct perf_counts_values zero; > bool skip = false; > + u64 val; > > if (check_per_pkg(evsel, count, cpu, &skip)) { > pr_err("failed to read per-pkg counter\n"); > @@ -270,6 +271,9 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel > > switch (config->aggr_mode) { > case AGGR_THREAD: > + val = count->val * evsel->scale; > + perf_stat__update_shadow_stats(evsel, &val, 0); > + break; > case AGGR_CORE: > case AGGR_SOCKET: > case AGGR_NONE: >