Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751958AbdHaQok (ORCPT ); Thu, 31 Aug 2017 12:44:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:34920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbdHaQoj (ORCPT ); Thu, 31 Aug 2017 12:44:39 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F9E62199E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Thu, 31 Aug 2017 13:44:37 -0300 From: Arnaldo Carvalho de Melo To: Stephane Eranian Cc: Peter Zijlstra , "Liang, Kan" , "mingo@redhat.com" , LKML , Jiri Olsa , Thomas Gleixner , "ak@linux.intel.com" , Michael Ellerman , Madhavan Srinivasan Subject: Re: [PATCH V6] perf: Add PERF_SAMPLE_PHYS_ADDR Message-ID: <20170831164437.GJ4831@kernel.org> References: <1503498166-3887-1-git-send-email-kan.liang@intel.com> <20170823143308.v27pgjagxjyd65ci@hirez.programming.kicks-ass.net> <20170823143959.m6k5xojly3q2tacv@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1196 Lines: 31 Em Wed, Aug 23, 2017 at 10:00:37AM -0700, Stephane Eranian escreveu: > On Wed, Aug 23, 2017 at 7:39 AM, Peter Zijlstra wrote: > > 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. > > Agreed. I may only care about physical addresses, so SAMPLE_PHYS_ADDR > should suffice from the user. > The kernel must save the virtual address in data->addr, and then convert it. Stephane, have you took the time to test this together with Kan's latest patchkit for tools/perf? v2? If so can I have your Tested-by or just an Acked-by? Thanks, - Arnaldo