From: Michal Simek <monstr@monstr.eu>
Date: Mon, 16 Nov 2009 08:55:08 +0000 (+0100)
Subject: microblaze: ftrace: enable HAVE_FUNCTION_TRACE_MCOUNT_TEST
X-Git-Tag: firefly_0821_release~9833^2~3863^2~36
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6d9e60ce30a1be35491c74df00aaa25d869f8a02;p=firefly-linux-kernel-4.4.55.git

microblaze: ftrace: enable HAVE_FUNCTION_TRACE_MCOUNT_TEST

Implement MCOUNT_TEST in asm code - it is faster than use
generic code

Signed-off-by: Michal Simek <monstr@monstr.eu>
---

diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 18003ca08196..cccf3adfae50 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -7,6 +7,7 @@ config MICROBLAZE
 	def_bool y
 	select HAVE_LMB
 	select HAVE_FUNCTION_TRACER
+	select HAVE_FUNCTION_TRACE_MCOUNT_TEST
 	select USB_ARCH_HAS_EHCI
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 
diff --git a/arch/microblaze/kernel/mcount.S b/arch/microblaze/kernel/mcount.S
index a257a1b75ed2..97eef3eea944 100644
--- a/arch/microblaze/kernel/mcount.S
+++ b/arch/microblaze/kernel/mcount.S
@@ -85,6 +85,11 @@ ENTRY(ftrace_stub)
 ENTRY(_mcount)
 	SAVE_REGS
 	swi	r15, r1, 0;
+	/* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST begin of checking */
+	lwi	r5, r0, function_trace_stop;
+	bneid	r5, end;
+	nop;
+	/* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST end of checking */
 	/* MS: test function trace if is taken or not */
 	lwi	r20, r0, ftrace_trace_function;
 	addik	r6, r0, ftrace_stub;