Received: by 10.223.185.116 with SMTP id b49csp3145215wrg; Mon, 12 Feb 2018 21:47:30 -0800 (PST) X-Google-Smtp-Source: AH8x227OwfMknMsAkkM0u8/3Q7b9WmO1AChaYVUuHDshtPduWL5mX3S4fxTgDf5OWLJ/WW+W5Ssy X-Received: by 10.98.166.198 with SMTP id r67mr120047pfl.40.1518500850186; Mon, 12 Feb 2018 21:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518500850; cv=none; d=google.com; s=arc-20160816; b=gkBpAW8RPkFM072wbmmlp+u7xWQ1nbHUFfxm9wd/RamjCrpaly+mLX/VEUSQ9kCWpf PJR8wPtm1Fdr94pX3Wy32AeXYTbw/7/WZp5XQZL7f0fpJBEPNqTlcJayhFTZGGXQ5bPj YberY2JknGl5/1L+13KNEd0ZTpGMiVC5NiBohLdA+RkH5+v3ljPFpUGcGlmb1hWdBARP RppiOCd1Yk6SauguIwHg1OmlUd5umBN2V3rd2xqdLYWciflpDXJu/NCb8w0PbMADtzL6 Qpvq0ZrRXni/SD0J+ZU9xpYZp9vcCR1RbrXgzFrXfGS1RD3ir5Qj8YhzY8fm86+BvcJ1 drMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=KJMxJQW1N8CdQtv9dTbtiI01oRjIHEVGGojbh18gIbI=; b=0y/dMufKjrzfkhIAswrXw7Z//WjKvyuuYgNeDcvtsPr0R03RgVnwUljbylGu9CrxzJ 1EwOFv7d/WyxGYmECkibEsk27ZAtbjLTyQbuTNZf6efIu8x4+powxEwhTFBYaDugCFBU 9xWsXTzxgNdwtT2UDwdR1AQfSaHTSgTHfPqrIWnabiW42sasNbRaf6eb7urA3FAVjhOi ZzE3cZfn+WhDmjAJ9vHlo6CLF87uv+qNnNgl2CInrOsLLIJav12lHkAxdS5P4X/sEg1g lZMBK6xOxtvKXryvbnvzXaszRxxJ5PIWDGpCinw+W9tjWna/GxTIvIW4Eejo+twlilqW MjTw== 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 x4si615045pfx.114.2018.02.12.21.47.15; Mon, 12 Feb 2018 21:47:30 -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 S1754194AbeBMFnF (ORCPT + 99 others); Tue, 13 Feb 2018 00:43:05 -0500 Received: from exmail.andestech.com ([59.124.169.137]:7147 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754046AbeBMFmW (ORCPT ); Tue, 13 Feb 2018 00:42:22 -0500 Received: from ATCSQR.andestech.com (localhost [127.0.0.2] (may be forged)) by ATCSQR.andestech.com with ESMTP id w1D5GTH9046282 for ; Tue, 13 Feb 2018 13:16:29 +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 w1D5GGQP046250; Tue, 13 Feb 2018 13:16:16 +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:26 +0800 From: Alan Kao To: Palmer Dabbelt , Albert Ou , "Steven Rostedt" , Ingo Molnar , , , CC: Alan Kao Subject: [PATCH v4 4/6] riscv/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support Date: Tue, 13 Feb 2018 13:13:19 +0800 Message-ID: <1518498801-677-5-git-send-email-alankao@andestech.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518498801-677-1-git-send-email-alankao@andestech.com> References: <1518498801-677-1-git-send-email-alankao@andestech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.1.85] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w1D5GGQP046250 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cc: Greentime Hu Signed-off-by: Alan Kao --- arch/riscv/include/asm/ftrace.h | 1 + arch/riscv/kernel/mcount-dyn.S | 3 +++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/include/asm/ftrace.h b/arch/riscv/include/asm/ftrace.h index 078743aacfd3..fedadc40e358 100644 --- a/arch/riscv/include/asm/ftrace.h +++ b/arch/riscv/include/asm/ftrace.h @@ -9,6 +9,7 @@ #define HAVE_FUNCTION_GRAPH_FP_TEST #endif +#define ARCH_SUPPORTS_FTRACE_OPS 1 #ifndef __ASSEMBLY__ void _mcount(void); static inline unsigned long ftrace_call_adjust(unsigned long addr) diff --git a/arch/riscv/kernel/mcount-dyn.S b/arch/riscv/kernel/mcount-dyn.S index 739e07a6fd85..6bbc3f88fcb3 100644 --- a/arch/riscv/kernel/mcount-dyn.S +++ b/arch/riscv/kernel/mcount-dyn.S @@ -74,9 +74,12 @@ ENTRY(ftrace_caller) /* * a0: the address in the caller when calling ftrace_caller * a1: the caller's return address + * a2: the address of global variable function_trace_op */ ld a1, -8(s0) addi a0, ra, -MCOUNT_INSN_SIZE + la t5, function_trace_op + ld a2, 0(t5) #ifdef CONFIG_FUNCTION_GRAPH_TRACER /* -- 2.15.1