Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965074AbeAJHi7 (ORCPT + 1 other); Wed, 10 Jan 2018 02:38:59 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:37188 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965015AbeAJHi4 (ORCPT ); Wed, 10 Jan 2018 02:38:56 -0500 X-Google-Smtp-Source: ACJfBovHI8v2HDlx1I++vLEU84c3jR6IblCHQ1OH93irGiAiRgAENzBFAk3B0wgAtlLZTTuXZ7/E2Q== From: Alan Kao X-Google-Original-From: Alan Kao To: Palmer Dabbelt , Albert Ou , Steven Rostedt , Ingo Molnar , Masahiro Yamada , Kamil Rytarowski , Andrew Morton , patches@groups.riscv.org, linux-kernel@vger.kernel.org Cc: Alan Kao , Greentime Hu Subject: [PATCH 4/6] riscv/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support Date: Wed, 10 Jan 2018 15:38:12 +0800 Message-Id: <20180110073814.32338-5-alankao@andestech.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180110073814.32338-1-alankao@andestech.com> References: <20180110073814.32338-1-alankao@andestech.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 acf0c7d001f3..429a6a156645 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 64e715d4e180..627478571c7a 100644 --- a/arch/riscv/kernel/mcount-dyn.S +++ b/arch/riscv/kernel/mcount-dyn.S @@ -75,9 +75,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