Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752001AbdIAP2d (ORCPT ); Fri, 1 Sep 2017 11:28:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34138 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbdIAP2b (ORCPT ); Fri, 1 Sep 2017 11:28:31 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AED64C058EDE Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Fri, 1 Sep 2017 17:28:27 +0200 From: Jiri Olsa To: kan.liang@intel.com Cc: acme@kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org, peterz@infradead.org, eranian@google.com, tglx@linutronix.de, ak@linux.intel.com Subject: Re: [PATCH V2 1/5] perf tools: support new sample type for physical address Message-ID: <20170901152814.GA21673@krava.homenet.telecomitalia.it> References: <1504026672-7304-1-git-send-email-kan.liang@intel.com> <1504026672-7304-2-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1504026672-7304-2-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 01 Sep 2017 15:28:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1891 Lines: 72 On Tue, Aug 29, 2017 at 01:11:08PM -0400, kan.liang@intel.com wrote: SNIP > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > index a5888c7..228a78d 100644 > --- a/tools/perf/util/evsel.c > +++ b/tools/perf/util/evsel.c > @@ -950,6 +950,9 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts, > if (opts->sample_address) > perf_evsel__set_sample_bit(evsel, DATA_SRC); > > + if (opts->sample_phys_addr) > + perf_evsel__set_sample_bit(evsel, PHYS_ADDR); > + > if (opts->no_buffering) { > attr->watermark = 0; > attr->wakeup_events = 1; > @@ -2201,6 +2204,12 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, > } > } > > + data->phys_addr = 0; > + if (type & PERF_SAMPLE_PHYS_ADDR) { > + data->phys_addr = *array; > + array++; > + } > + > return 0; > } > > @@ -2306,6 +2315,9 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type, > } > } > > + if (type & PERF_SAMPLE_PHYS_ADDR) > + result += sizeof(u64); > + > return result; > } > > @@ -2495,6 +2507,11 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, > } > } > > + if (type & PERF_SAMPLE_PHYS_ADDR) { > + *array = sample->phys_addr; > + array++; > + } > + > return 0; > } > missing the printing bits jirka diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index e705c0d59a69..4bb89373eb52 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1467,7 +1467,7 @@ static void __p_sample_type(char *buf, size_t size, u64 value) bit_name(PERIOD), bit_name(STREAM_ID), bit_name(RAW), bit_name(BRANCH_STACK), bit_name(REGS_USER), bit_name(STACK_USER), bit_name(IDENTIFIER), bit_name(REGS_INTR), bit_name(DATA_SRC), - bit_name(WEIGHT), + bit_name(WEIGHT), bit_name(PHYS_ADDR), { .name = NULL, } }; #undef bit_name