Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751888AbdHaQnc (ORCPT ); Thu, 31 Aug 2017 12:43:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:34680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbdHaQnb (ORCPT ); Thu, 31 Aug 2017 12:43:31 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97E6A21978 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:43:27 -0300 From: Arnaldo Carvalho de Melo To: Peter Zijlstra Cc: Madhavan Srinivasan , kan.liang@intel.com, mingo@redhat.com, linux-kernel@vger.kernel.org, jolsa@redhat.com, tglx@linutronix.de, eranian@google.com, ak@linux.intel.com, mpe@ellerman.id.au Subject: Re: [PATCH V8] perf: Add PERF_SAMPLE_PHYS_ADDR Message-ID: <20170831164327.GI4831@kernel.org> References: <1503967969-48278-1-git-send-email-kan.liang@intel.com> <5af3f1ab-b139-2c41-3218-1cba5ee3803e@linux.vnet.ibm.com> <20170829114553.mwd6btebikpoh6fi@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170829114553.mwd6btebikpoh6fi@hirez.programming.kicks-ass.net> 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: 1730 Lines: 37 Em Tue, Aug 29, 2017 at 01:45:53PM +0200, Peter Zijlstra escreveu: > On Tue, Aug 29, 2017 at 05:05:15PM +0530, Madhavan Srinivasan wrote: > > > > > > On Tuesday 29 August 2017 06:22 AM, kan.liang@intel.com wrote: > > > From: Kan Liang > > > > > > For understanding how the workload maps to memory channels and hardware > > > behavior, it's very important to collect address maps with physical > > > addresses. For example, 3D XPoint access can only be found by filtering > > > the physical address. > > > > > > Add a new sample type for physical address. > > > > > > perf already has a facility to collect data virtual address. This patch > > > introduces a function to convert the virtual address to physical address. > > > The function is quite generic and can be extended to any architecture as > > > long as a virtual address is provided. > > > - For kernel direct mapping addresses, virt_to_phys is used to convert > > > the virtual addresses to physical address. > > > - For user virtual addresses, __get_user_pages_fast is used to walk the > > > pages tables for user physical address. > > > - This does not work for vmalloc addresses right now. These are not > > > resolved, but code to do that could be added. > > > > > > The new sample type requires collecting the virtual address. The > > > virtual address will not be output unless SAMPLE_ADDR is applied. > > > > > > For security, the physical address can only be exposed to root or > > > privileged user. > > > > Tested-by: Madhavan Srinivasan You mean you tested this together with Kan's v2 perf tools patches? If that is so I'll add this tested-by to those patches, ok? > Thanks maddy!