Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1594618yba; Fri, 17 May 2019 01:49:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNILi4ieBdnwgSoTDIyTz7+nfxtsbE9xxaZnhNT/3NosAY9s5dX2XbQ8lhG0+iagC02CRs X-Received: by 2002:a62:1ec3:: with SMTP id e186mr13394939pfe.197.1558082958814; Fri, 17 May 2019 01:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558082958; cv=none; d=google.com; s=arc-20160816; b=PNzO1t3oDKLxFLKVB0W8xi3z/+KHFNp/LMJdj7TFQ19U121TCckMFJRepDFeapD1oh y0cHUPmerbS75HRta++KkczZAA1VzSrDr1tpt8qgaoPapaTCImkzrH6HSyAfJXISDV6R Te82L0byNICkm+7gIu6NizaJiuEg85v0r6jWifVcBn2lxu/9RrM0J4gUdBNh321cirWI 68fYWgZAbP7axnm0GLtAH0w5WDonrOL+tqa7pAWbA+fJfQ0iq5Oa8HnrrftbwR1oeFg4 2lDlERQCcWyE03RYFVQw7NENAoso2+HeWIwwuYuFKSG+cWiWwJCOmgj0wSQfakHBT8dH ZAzA== 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=XWShFNTWuea96M81OHkljcwJZQLNl2/vKnCWCqBBUDM=; b=osyFoeWqCXTtFIgOAy6FjM2Hdehv6jUForJgrcp3Lu1go7I7T5IlFKUCOqqDIxR5vs ps8Jb7VvAR4Yc/+GmHTiaQY+OqpEcsfHLzbY816tEp4boCJinAl9QiMPv2b6XgV350Zn UwU7bwoSuO6aeZauo2/HFiRgSm25YJYc3Duzp0A1CW120ifPOHuq7sX0xMLy15sHI4jB /CO9H0u9iZ4Q3xLfW3mod0AMp0Ai6KoeVTva7tAvyZwDRcSzOwj7CWS4pGzyQee/i+HE 5QJpIzQkhucTi7Y1+NIQv2deCsvXrhTmf1vgCPPZ5GymzJSDc2R8SRn2Q8So2E4XOAZr EdCQ== 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 g3si1951589pgq.247.2019.05.17.01.49.03; Fri, 17 May 2019 01:49:18 -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 S1728444AbfEQIoo (ORCPT + 99 others); Fri, 17 May 2019 04:44:44 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:33355 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727785AbfEQIom (ORCPT ); Fri, 17 May 2019 04:44:42 -0400 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 Cc: Mao Han , Palmer Dabbelt , linux-riscv , Christoph Hellwig , Guo Ren 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 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.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 -- 2.7.4