Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbbG2NgD (ORCPT ); Wed, 29 Jul 2015 09:36:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56373 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895AbbG2NgB (ORCPT ); Wed, 29 Jul 2015 09:36:01 -0400 Date: Wed, 29 Jul 2015 15:14:54 +0200 From: Jiri Olsa To: kan.liang@intel.com Cc: a.p.zijlstra@chello.nl, acme@kernel.org, luto@kernel.org, mingo@redhat.com, eranian@google.com, ak@linux.intel.com, mark.rutland@arm.com, adrian.hunter@intel.com, jolsa@kernel.org, namhyung@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 3/5] perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -D Message-ID: <20150729131454.GJ9606@krava.brq.redhat.com> References: <1438082975-47730-1-git-send-email-kan.liang@intel.com> <1438082975-47730-4-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438082975-47730-4-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: 1812 Lines: 57 On Tue, Jul 28, 2015 at 07:29:33AM -0400, kan.liang@intel.com wrote: SNIP > > -static void sample_read__printf(struct perf_sample *sample, u64 read_format) > +static void sample_read__printf(struct perf_session *session, > + struct perf_evlist *evlist, > + struct perf_sample *sample, > + u64 read_format) > { > + struct perf_evsel *evsel; > + struct perf_sample_id *sid; > + u64 data[FREQ_PERF_MAX] = { 0 }; > + u64 cpu_max_freq = session->header.env.cpu_attr[PERF_HEADER_CPU_MAX_FREQ]; > + > printf("... sample_read:\n"); > > if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) > @@ -875,10 +883,26 @@ static void sample_read__printf(struct perf_sample *sample, u64 read_format) > printf("..... id %016" PRIx64 > ", value %016" PRIx64 "\n", > value->id, value->value); should 2 hunks hunk below go under symbol_conf.show_freq_perf condition ? jirka > + > + sid = perf_evlist__id2sid(evlist, value->id); > + evsel = sid->evsel; > + if (evsel != NULL) > + SET_FREQ_PERF_VALUE(session->header.env.msr_pmu_type, > + evsel, data, value->value); > } > } else > printf("..... id %016" PRIx64 ", value %016" PRIx64 "\n", > sample->read.one.id, sample->read.one.value); > + > + if (HAS_FREQ(data)) > + printf("..... Freq %lu MHz\n", > + GET_FREQ(data, cpu_max_freq/1000)); > + if (HAS_CPU_UTIL(data)) > + printf("..... CPU%% %lu%%\n", > + GET_CPU_UTIL(data)); > + if (HAS_CORE_BUSY(data)) > + printf("..... CORE_BUSY%% %lu%%\n", > + GET_CORE_BUSY(data)); > } > SNIP -- 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/