From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932196AbdESIVd (ORCPT ); Fri, 19 May 2017 04:21:33 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33258 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753619AbdESIU5 (ORCPT ); Fri, 19 May 2017 04:20:57 -0400 Subject: Re: [PATCH] perf: libdw support for powerpc From: Paolo Bonzini To: "Naveen N. Rao" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: acme@kernel.org, Ravi Bangoria , linuxppc-dev@lists.ozlabs.org References: <20170518170018.10507-1-pbonzini@redhat.com> <1495131092.c1jiws8vlt.astroid@naverao1-tp.none> Message-ID: <24a6080b-c0bb-9965-013c-60b4368c649c@redhat.com> Date: Fri, 19 May 2017 10:20:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/05/2017 20:48, Paolo Bonzini wrote: > > > On 18/05/2017 20:19, Naveen N. Rao wrote: >> Paolo Bonzini wrote: >>> The ARM and x86 architectures already use libdw, and it is useful to >>> have as much common code for the unwinder as possible. Porting PPC >>> to libdw only needs an architecture-specific hook to move the register >>> state from perf to libdw. >> >> Thanks. Ravi has had a similar patch locally, but from what I >> understand, there are issues with libdw based unwinding on powerpc64. I >> gave this a quick test and I don't see the user-space call trace being >> unwinded properly with libdw. > > I don't see that problem: > > - 99,98% 0,00% dd libc-2.17.so [.] generic_start_main.isra.0 > generic_start_main.isra.0 > - main > - 99,97% iread > - 97,82% sys_read > - 96,97% extract_entropy_user > 89,44% powernv_get_random_long > 4,63% sha_transform > 2,07% extract_buf > 1,15% _raw_spin_lock_irqsave > 0,51% extract_buf > > (This is "perf record dd if=/dev/urandom of=/dev/null bs=512"). > > Can you copy the contents of tools/perf/.config-detected here? FWIW it works fine for me here with latest Linus tree and your suggested change to fix compilation: --- a/tools/perf/arch/powerpc/util/unwind-libdw.c +++ b/tools/perf/arch/powerpc/util/unwind-libdw.c @@ -1,7 +1,7 @@ #include -#include "../../util/util.h" #include "../../util/unwind-libdw.h" #include "../../util/perf_regs.h" +#include "../../util/event.h" /* See backends/ppc_initreg.c and backends/ppc_regs.c in elfutils. */ static const int special_regs[3][2] = { Thanks, Paolo