From patchwork Fri May 19 08:20:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9736283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 28ACF601C2 for ; Fri, 19 May 2017 08:21:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F239A2866A for ; Fri, 19 May 2017 08:21:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E630B288E5; Fri, 19 May 2017 08:21:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0B792866A for ; Fri, 19 May 2017 08:21:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932125AbdESIVc (ORCPT ); Fri, 19 May 2017 04:21:32 -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 Received: by mail-wm0-f67.google.com with SMTP id b84so751981wmh.0; Fri, 19 May 2017 01:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0zS9O3d77mvP33TLIIFsMg/mT7m86aNUYEOdRmGPaic=; b=rQ4O/n3dpxkVYBj9yW6YDqY9E8yoSaDI4CKKsTWM2n2yHf0lajLHo+QLbirCN7Iq5H 3aslzfqL4PCda1F2/GwvHiGBzxTzbyh7Hd0Fx9AmQLH6yh9uVlDRmr7HThqrK+AR3oYl QGX78XhGY+PGKaZbHEJaPyOVAkLvoQZryaMNa0kbNfBhnwr6ELUB/tpRKfA17Kr1mySt ZM7vgNDJU097V8si4kK+TgsH5NecELMCdZ2klx9JQYs05LB70kmUEd3zEhZjg9YCn8Gk dF7eLfz61qq2dWiXZrZ2wpYb2v0v0kJcfIk8DbmLWgvhBzb5ZM0S44U4U9A5+7aGqstG 0XCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0zS9O3d77mvP33TLIIFsMg/mT7m86aNUYEOdRmGPaic=; b=cgk9e4XiR7hITwaCGoZAvGLzdFM4a/d3SNEExLubwR5KbNJp9fDG1W5o8fZUfZkzIZ GfUPk3yQCU707aLJfyx00/iXtFEj3BwvhkQp6/MUvlfdq4qN2qP4Rh2wmzHQPsypm0Ii oY91DKVjBjEchlIiFPJ/hBIfYH7aMZA953DkEsEcc9PYHU2nlRsoa1wK50gT0e+quN3u +sKjGchmQzUcP/kkCy6UhwGpXdJkE/bqg2WoPQd0ouZtAwa1OJYgV9Ub2PSOzpS9gYfz 7NgHYtF6TvRCS/HXZzqy1j3UbSzVAIuhj3VgljSn2MH3AhnofqaRj1dqRo9tQ+vE3auT Z7RQ== X-Gm-Message-State: AODbwcA+UqXdUBHCbopw4T7LjhTf/00QJXF0CmbbpDE7e7TB6wOsJQWj RtbjXFUD47/RfA== X-Received: by 10.28.182.70 with SMTP id g67mr5849710wmf.139.1495182051289; Fri, 19 May 2017 01:20:51 -0700 (PDT) Received: from [192.168.10.165] (94-39-157-43.adsl-ull.clienti.tiscali.it. [94.39.157.43]) by smtp.googlemail.com with ESMTPSA id t30sm2025465wrc.24.2017.05.19.01.20.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 01:20:50 -0700 (PDT) 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-Language: en-US Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Thanks, Paolo --- 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] = {