Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753308AbbH0SKw (ORCPT ); Thu, 27 Aug 2015 14:10:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831AbbH0SKv (ORCPT ); Thu, 27 Aug 2015 14:10:51 -0400 Date: Thu, 27 Aug 2015 20:10:46 +0200 From: Jiri Olsa To: Kan Liang Cc: acme@kernel.org, jolsa@kernel.org, a.p.zijlstra@chello.nl, luto@kernel.org, mingo@redhat.com, eranian@google.com, ak@linux.intel.com, mark.rutland@arm.com, adrian.hunter@intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V5 6/7] perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stat Message-ID: <20150827181045.GD25932@krava.redhat.com> References: <1440494288-20448-1-git-send-email-kan.liang@intel.com> <1440494288-20448-7-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440494288-20448-7-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1421 Lines: 38 On Tue, Aug 25, 2015 at 05:18:07AM -0400, Kan Liang wrote: > From: Kan Liang > > Caculate freq/CPU%/CORE_BUSY% in add_entry_cb, and update the value in > he_stat. > > Signed-off-by: Kan Liang > --- > tools/perf/builtin-report.c | 36 ++++++++++++++++++++++++++++++++++++ > tools/perf/util/sort.h | 3 +++ > 2 files changed, 39 insertions(+) > > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c > index 62b285e..1bc74acd 100644 > --- a/tools/perf/builtin-report.c > +++ b/tools/perf/builtin-report.c > @@ -89,6 +89,38 @@ static int report__config(const char *var, const char *value, void *cb) > return perf_default_config(var, value, cb); > } > > +static void set_he_freq_perf(struct perf_session *session, > + struct hist_entry_iter *iter) > +{ > + struct hist_entry *he = iter->he; > + struct perf_evsel *evsel = iter->evsel; > + struct perf_evsel *leader = evsel; > + struct perf_sample *sample = iter->sample; > + struct perf_evlist *evlist = session->evlist; > + u64 cpu_max_freq = session->header.env.cpu_attr[PERF_HEADER_CPU_MAX_FREQ]; so why not access the cpu_attr.freq ? jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/