Received: by 10.223.185.116 with SMTP id b49csp3144594wrg; Mon, 12 Feb 2018 21:46:42 -0800 (PST) X-Google-Smtp-Source: AH8x226AMxApxsSaySYxTq5k3wxhbTQmw/JozbgftTRUni8x66ZrNz84UmgRn4d+Kh9WkUWyjutu X-Received: by 2002:a17:902:2c43:: with SMTP id m61-v6mr44125plb.387.1518500802176; Mon, 12 Feb 2018 21:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518500802; cv=none; d=google.com; s=arc-20160816; b=qSIIDG5B3mKCBILzF67tZFUwccp+euygW85c+8oTvbWT32/SU91/7KIc9OppKfrSQU MMFGruB9dpJqhU3dLszyA0OKwEHs4hlvfmnyDHh+vsT/PPqhHSDKyhMInlbfiK5RJxLS UoAHprpOcQXhoD2x7+mnbl+rWdYlPXN4mhdoH7HtX1ppwWU31jOzmxcm4OCqBEZjo1aK /r4QTj8KciDibyv02Uw+T8qwecQQ3wsHq0jKHggXnZT/NP/eo9oIfbS6ZqP1dzugs53Q v6rHoQs78CUNMvi1b/r5B8pKweYWbFKTVBUitLriG18i6QK0BeSVTM7SKC5z77DsOdS+ KWQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=I3A6jmL688cpyzpa6aoUvtaH2v+A9pL/YfzDm5P1yxc=; b=uMrbME+4xtsjw+EST4EXmRYWOjPxzslXYRtbTmrGJ/Ug6ng/eSeEE9JjBq/slKEDQN JMn5MMY1jM9t9/ADfyWiqCdJOsywzDrgNXhY25kFyFT8keq8l9e8Di73LsQ9VzVV0IZK yPjKVuHc/CJGyGwmQIOjhj9xDGobykKUbta8mbKJWbyemYCr0gd+QuK074omy9wF3jV4 KnhqEBKQX/6wpf+bFhyWYnjMkBBuOVrWYzpZoy4eNg2hzhTBsCc11plF0eZvRuzxHKG7 lIYYjqrwb1LtrdqM2cNpdBjjkmJe3B2zdYG4hPRQkHxXqtm2Z5EcVKTzHnbEk2N6D72V rJ1g== 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 q11si831353pgc.617.2018.02.12.21.46.26; Mon, 12 Feb 2018 21:46:42 -0800 (PST) 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 S1751973AbeBMFmQ (ORCPT + 99 others); Tue, 13 Feb 2018 00:42:16 -0500 Received: from exmail.andestech.com ([59.124.169.137]:7431 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751235AbeBMFmP (ORCPT ); Tue, 13 Feb 2018 00:42:15 -0500 X-Greylist: delayed 1481 seconds by postgrey-1.27 at vger.kernel.org; Tue, 13 Feb 2018 00:42:14 EST Received: from ATCSQR.andestech.com (localhost [127.0.0.2] (may be forged)) by ATCSQR.andestech.com with ESMTP id w1D5GJEd046259 for ; Tue, 13 Feb 2018 13:16:19 +0800 (GMT-8) (envelope-from alankao@andestech.com) Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w1D5Ft9P046186; Tue, 13 Feb 2018 13:15:55 +0800 (GMT-8) (envelope-from alankao@andestech.com) Received: from atcsqa06.andestech.com (10.0.1.85) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Tue, 13 Feb 2018 13:17:08 +0800 From: Alan Kao To: Palmer Dabbelt , Albert Ou , "Steven Rostedt" , Ingo Molnar , , , CC: Alan Kao Subject: [PATCH v4 0/6] Add dynamic ftrace support for RISC-V platforms Date: Tue, 13 Feb 2018 13:13:15 +0800 Message-ID: <1518498801-677-1-git-send-email-alankao@andestech.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.1.85] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w1D5Ft9P046186 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set includes the building blocks of dynamic ftrace features for RISC-V machines. Changes in v4: - Organize code structure according to changes in v3 - Rebase onto the riscv-linux-4.15 branch at github's riscv/riscv-linux repo. Note that this set is based on the previous ftrace patch, which provided basic support. Changes in v3: - Replace the nops at the tracer call sites into "call ftrace_stub" instructions for better understanding (1/6, 2/6 and 5/6) Changes in v2: - Fix the return value as writing to kernel text goes wrong (2/6) - Replace manual comparisons by calling memcmp (2/6) - Simplify the conditional assignment in the Makefile (1/6) Alan Kao (6): riscv/ftrace: Add RECORD_MCOUNT support riscv/ftrace: Add dynamic function tracer support riscv/ftrace: Add dynamic function graph tracer support riscv/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support riscv/ftrace: Add DYNAMIC_FTRACE_WITH_REGS support riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support arch/riscv/Kconfig | 3 + arch/riscv/Makefile | 3 + arch/riscv/include/asm/ftrace.h | 56 ++++++++++ arch/riscv/kernel/Makefile | 5 +- arch/riscv/kernel/ftrace.c | 175 ++++++++++++++++++++++++++++- arch/riscv/kernel/mcount-dyn.S | 239 ++++++++++++++++++++++++++++++++++++++++ arch/riscv/kernel/mcount.S | 22 ++-- arch/riscv/kernel/stacktrace.c | 6 + scripts/recordmcount.pl | 5 + 9 files changed, 501 insertions(+), 13 deletions(-) create mode 100644 arch/riscv/kernel/mcount-dyn.S -- 2.15.1