Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932120AbdHWOkV (ORCPT ); Wed, 23 Aug 2017 10:40:21 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38498 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754053AbdHWOkT (ORCPT ); Wed, 23 Aug 2017 10:40:19 -0400 Date: Wed, 23 Aug 2017 16:39:59 +0200 From: Peter Zijlstra To: kan.liang@intel.com Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, acme@kernel.org, jolsa@redhat.com, tglx@linutronix.de, eranian@google.com, ak@linux.intel.com, mpe@ellerman.id.au, maddy@linux.vnet.ibm.com Subject: Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR Message-ID: <20170823143959.m6k5xojly3q2tacv@hirez.programming.kicks-ass.net> References: <1503498166-3887-1-git-send-email-kan.liang@intel.com> <20170823143308.v27pgjagxjyd65ci@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170823143308.v27pgjagxjyd65ci@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 613 Lines: 17 On Wed, Aug 23, 2017 at 04:33:08PM +0200, Peter Zijlstra wrote: > > @@ -6145,6 +6183,9 @@ void perf_prepare_sample(struct perf_event_header *header, > > > > header->size += size; > > } > > + > > + if (sample_type & PERF_SAMPLE_PHYS_ADDR) > > + data->phys_addr = perf_virt_to_phys(data->addr); > > Only problem with this now is that it requires SAMPLE_ADDR to also be > set in order to obtain data->addr. > > Either fix all to set data->attr for (SAMPLE_ADDR || SAMPLE_PHYS_ADDR) > or mandate SAMPLE_ADDR when SAMPLE_PHYS_ADDR. I think the former suggestion is better, as it allows for smaller samples.