From patchwork Fri May 17 08:43:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mao Han X-Patchwork-Id: 10947491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 464161398 for ; Fri, 17 May 2019 08:44:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30603223B3 for ; Fri, 17 May 2019 08:44:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2245F228C9; Fri, 17 May 2019 08:44:53 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C22EC223B3 for ; Fri, 17 May 2019 08:44:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=QxYTilPXYCYEWR/Wv0w3pVm/FUinhZWcqxkqswm3cE4=; b=ZE9 Hg0rDm8A4CouHj8v0o5aTIwqgUm/VTDLZrYWtHXkJz5tU/aRTGfi4iO78lL5kyELD4alrKoJddEaQ 1FUlAdDDynfMdJC5mKIYuz5V1bBHECnwaVeWMpzJz+fUr1AvDRUE+mc2cTT7gCBYGG0iLEVxjRg2b +3+TCfOxOeCGRpr4/uArsir1OWoSovweDMVkQ7VBFLqgY+qqRH/aBorFyv2tpAhW8h/9JTOJ2yhli mUKACKvlT8xrWHnZ820vcMFNEYjrv04BlKqrfmtnE1dJCbnyAybBxbDAmcs+cfVS8BJRE94m3rFyH g6fljvAaLvkIjDu6m4Hl+ZKVloAwO3Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRYTw-0008Pq-UF; Fri, 17 May 2019 08:44:48 +0000 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRYTs-0008NL-7k for linux-riscv@lists.infradead.org; Fri, 17 May 2019 08:44:46 +0000 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.07501326|-1; CH=green; DM=CONTINUE|CONTINUE|true|0.506319-0.105779-0.387902; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03278; MF=han_mao@c-sky.com; NM=1; PH=DS; RN=6; RT=6; SR=0; TI=SMTPD_---.EZL4FGh_1558082675; Received: from localhost(mailfrom:han_mao@c-sky.com fp:SMTPD_---.EZL4FGh_1558082675) by smtp.aliyun-inc.com(10.147.43.230); Fri, 17 May 2019 16:44:36 +0800 From: Mao Han To: linux-kernel@vger.kernel.org Subject: [PATCH V3 0/3] riscv: Add perf callchain support Date: Fri, 17 May 2019 16:43:01 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190517_014445_444532_1878DDDD X-CRM114-Status: UNSURE ( 7.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-riscv , Palmer Dabbelt , Guo Ren , Christoph Hellwig , Mao Han MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch set add perf callchain(FP/DWARF) support for RISC-V. It comes from the csky version callchain support with some slight modifications. The patchset base on Linux 5.1. CC: Palmer Dabbelt CC: linux-riscv CC: Christoph Hellwig CC: Guo Ren Changes since v2: - fix inconsistent comment - force to build kernel with -fno-omit-frame-pointer if perf event is enabled Changes since v1: - simplify implementation and code convention Mao Han (3): riscv: Add perf callchain support riscv: Add support for perf registers sampling riscv: Add support for libdw arch/riscv/Kconfig | 2 + arch/riscv/Makefile | 3 + arch/riscv/include/uapi/asm/perf_regs.h | 42 ++++++++++ arch/riscv/kernel/Makefile | 4 +- arch/riscv/kernel/perf_callchain.c | 113 ++++++++++++++++++++++++++ arch/riscv/kernel/perf_regs.c | 44 ++++++++++ tools/arch/riscv/include/uapi/asm/perf_regs.h | 42 ++++++++++ tools/perf/Makefile.config | 6 +- tools/perf/arch/riscv/Build | 1 + tools/perf/arch/riscv/Makefile | 3 + tools/perf/arch/riscv/include/perf_regs.h | 96 ++++++++++++++++++++++ tools/perf/arch/riscv/util/Build | 2 + tools/perf/arch/riscv/util/dwarf-regs.c | 72 ++++++++++++++++ tools/perf/arch/riscv/util/unwind-libdw.c | 57 +++++++++++++ 14 files changed, 485 insertions(+), 2 deletions(-) create mode 100644 arch/riscv/include/uapi/asm/perf_regs.h create mode 100644 arch/riscv/kernel/perf_callchain.c create mode 100644 arch/riscv/kernel/perf_regs.c create mode 100644 tools/arch/riscv/include/uapi/asm/perf_regs.h create mode 100644 tools/perf/arch/riscv/Build create mode 100644 tools/perf/arch/riscv/Makefile create mode 100644 tools/perf/arch/riscv/include/perf_regs.h create mode 100644 tools/perf/arch/riscv/util/Build create mode 100644 tools/perf/arch/riscv/util/dwarf-regs.c create mode 100644 tools/perf/arch/riscv/util/unwind-libdw.c