All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Kao <nonerkao@gmail.com>
To: Palmer Dabbelt <palmer@sifive.com>, Albert Ou <albert@sifive.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Kamil Rytarowski <n54@gmx.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	patches@groups.riscv.org, linux-kernel@vger.kernel.org,
	"Stefan O'Rear" <sorear2@gmail.com>
Cc: Alan Kao <alankao@andestech.com>, Greentime Hu <greentime@andestech.com>
Subject: [PATCH v3 4/6] riscv/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support
Date: Thu, 18 Jan 2018 23:45:43 +0800	[thread overview]
Message-ID: <20180118154545.17987-5-alankao@andestech.com> (raw)
In-Reply-To: <20180118154545.17987-1-alankao@andestech.com>

Cc: Greentime Hu <greentime@andestech.com>
Signed-off-by: Alan Kao <alankao@andestech.com>
---
 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 1ddf8b1a9345..c8959bdd4f38 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

  parent reply	other threads:[~2018-01-18 15:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 15:45 [PATCH v3 0/6] Add dynamic ftrace support for RISC-V platforms Alan Kao
2018-01-18 15:45 ` [PATCH v3 1/6] riscv/ftrace: Add RECORD_MCOUNT support Alan Kao
2018-01-18 15:45 ` [PATCH v3 2/6] riscv/ftrace: Add dynamic function tracer support Alan Kao
2018-01-18 15:45 ` [PATCH v3 3/6] riscv/ftrace: Add dynamic function graph " Alan Kao
2018-01-18 15:45 ` Alan Kao [this message]
2018-01-18 15:45 ` [PATCH v3 5/6] riscv/ftrace: Add DYNAMIC_FTRACE_WITH_REGS support Alan Kao
2018-01-18 15:45 ` [PATCH v3 6/6] riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support Alan Kao
2018-02-08  0:37 ` [patches] [PATCH v3 0/6] Add dynamic ftrace support for RISC-V platforms Palmer Dabbelt
2018-02-08  0:52   ` Alan Kao
2018-02-08  2:57   ` Alan Kao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180118154545.17987-5-alankao@andestech.com \
    --to=nonerkao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alankao@andestech.com \
    --cc=albert@sifive.com \
    --cc=greentime@andestech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=n54@gmx.com \
    --cc=palmer@sifive.com \
    --cc=patches@groups.riscv.org \
    --cc=rostedt@goodmis.org \
    --cc=sorear2@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.