Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3773962ybl; Tue, 20 Aug 2019 01:58:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6YBKgAlBuva15B1Y9q9cNa+Bpvv0j44THlaTdAWiCgzpTdUbd5tGKBNIuGiZoHmPozdUP X-Received: by 2002:a65:4509:: with SMTP id n9mr23597785pgq.133.1566291531536; Tue, 20 Aug 2019 01:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566291531; cv=none; d=google.com; s=arc-20160816; b=UyTEP60elEGoccuufg5YO9mkWiO0JSDSRN/n362mTHoCusfT9Tqx+kIoOL2pzCqLY4 xQMtSBv/gDt+p7NQ01D6OtGiTh4o/iZlU7A33fW5KGyVvfGh7/HPCzXLu7aIyzWnoCFs jsN07V7JrN0t6iFvonYGDwoDpl3Qphva5uG5wi9JXmcFHjm3EYihpNA1WR33mLWzkSQG DiwcmkY3v4Bcsgthjii8gBOomDCDPXwYNC+Z5q8qTzibnwikT6qEInhD/Y8zOtODxR6D R0XiQAFWrEQrremLFTRllMv7Nk70y9PBMEBMpGmHEom285dojHV+WaYaueTyQhz4GAxJ ul/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=JwmwP8h/RNbjn3/YRXP8aWKSACU3egYDkYfw+XlAQlI=; b=a8ujn9Bk1MNeBODEKXYIijWrGHngRCrw9xfY777wQigWZUDfPkqFFucrTR/kT1Wq5e OdkFuFg3e1/OEamrZq7ZzrcIzS/xMcq0r2lMCVGiWEKNZXJ9MotdrIvLvPY7RkQLy37a zcWE5qDA2w2S25i33AbaxJnNf2fyzmFmALKESNOtg0kjS4rqZf/n8VtMA2qLXZvA6oPq uYmcEfnNGMxSRMZOfx78SWFx7wQWQBL75HthfcnKxy3wdyaT1gX4h13gdSOB01rezCg+ xmWiUz9H7LMMCDQ2wKsvrQnlviM9GGCaF5XnMqlbkc0iUjxNeA3DTSO1plIqBZf3PwMZ 5TCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si11545967pgh.400.2019.08.20.01.58.36; Tue, 20 Aug 2019 01:58:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729518AbfHTI5c (ORCPT + 99 others); Tue, 20 Aug 2019 04:57:32 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:47862 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728771AbfHTI5c (ORCPT ); Tue, 20 Aug 2019 04:57:32 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07471972|-1;CH=green;DM=CONTINUE|CONTINUE|true|0.509175-0.104397-0.386427;FP=0|0|0|0|0|-1|-1|-1;HT=e01l01425;MF=han_mao@c-sky.com;NM=1;PH=DS;RN=8;RT=8;SR=0;TI=SMTPD_---.FFA.Zkd_1566291445; Received: from localhost(mailfrom:han_mao@c-sky.com fp:SMTPD_---.FFA.Zkd_1566291445) by smtp.aliyun-inc.com(10.147.44.145); Tue, 20 Aug 2019 16:57:26 +0800 From: Mao Han To: linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Mao Han , Paul Walmsley , Greentime Hu , Palmer Dabbelt , Christoph Hellwig , Guo Ren Subject: [PATCH V4 0/3] riscv: Add perf callchain support Date: Tue, 20 Aug 2019 16:57:15 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.3. Changes since v3: - Add more strict check for unwind_frame_kernel - update for kernel 5.3 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 Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig Cc: Guo Ren 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 | 115 ++++++++++++++++++++++++++ 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, 487 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 -- 2.7.4