All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ftrace: PPC, fix obsolete comment
@ 2014-04-29  7:24 ` Jiri Slaby
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Slaby @ 2014-04-29  7:24 UTC (permalink / raw)
  To: rostedt
  Cc: jirislaby, linux-kernel, Ingo Molnar, Paul Mackerras,
	Frederic Weisbecker, Jiri Slaby, linuxppc-dev

CONFIG_MCOUNT is not defined anymore, the corresponding #ifdef there
is CONFIG_FUNCTION_TRACER.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: <linuxppc-dev@lists.ozlabs.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
---
 arch/powerpc/kernel/entry_32.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 22b45a4955cd..f1f652a8f395 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -1457,4 +1457,4 @@ _GLOBAL(return_to_handler)
 	blr
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 
-#endif /* CONFIG_MCOUNT */
+#endif /* CONFIG_FUNCTION_TRACER */
-- 
1.9.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/2] ftrace: PPC, fix obsolete comment
@ 2014-04-29  7:24 ` Jiri Slaby
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Slaby @ 2014-04-29  7:24 UTC (permalink / raw)
  To: rostedt
  Cc: jirislaby, linux-kernel, Jiri Slaby, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev, Frederic Weisbecker, Ingo Molnar

CONFIG_MCOUNT is not defined anymore, the corresponding #ifdef there
is CONFIG_FUNCTION_TRACER.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: <linuxppc-dev@lists.ozlabs.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
---
 arch/powerpc/kernel/entry_32.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 22b45a4955cd..f1f652a8f395 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -1457,4 +1457,4 @@ _GLOBAL(return_to_handler)
 	blr
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 
-#endif /* CONFIG_MCOUNT */
+#endif /* CONFIG_FUNCTION_TRACER */
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] fentry: x86, cleanup function_hook uses
  2014-04-29  7:24 ` Jiri Slaby
  (?)
@ 2014-04-29  7:24 ` Jiri Slaby
  2014-04-29  7:28   ` H. Peter Anvin
  -1 siblings, 1 reply; 5+ messages in thread
From: Jiri Slaby @ 2014-04-29  7:24 UTC (permalink / raw)
  To: rostedt
  Cc: jirislaby, linux-kernel, Jiri Slaby, Thomas Gleixner,
	H. Peter Anvin, x86, Frederic Weisbecker, Ingo Molnar

Let's define fentry_hook depending on CC_USING_FENTRY and use that
macro all over. This saves some #ifdef's here and there.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <x86@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
---
 arch/x86/include/asm/fentry.h    | 14 ++++++++++++++
 arch/x86/include/asm/ftrace.h    | 10 +++-------
 arch/x86/kernel/entry_64.S       | 15 +++++----------
 arch/x86/kernel/x8664_ksyms_64.c |  8 ++------
 4 files changed, 24 insertions(+), 23 deletions(-)
 create mode 100644 arch/x86/include/asm/fentry.h

diff --git a/arch/x86/include/asm/fentry.h b/arch/x86/include/asm/fentry.h
new file mode 100644
index 000000000000..febe8d272f0f
--- /dev/null
+++ b/arch/x86/include/asm/fentry.h
@@ -0,0 +1,14 @@
+#ifndef ASM_FENTRY_H
+#define ASM_FENTRY_H
+
+#ifdef CC_USING_FENTRY
+# define fentry_hook	__fentry__
+#else
+# define fentry_hook	mcount
+#endif
+
+#ifndef __ASSEMBLY__
+extern void fentry_hook(void);
+#endif /* __ASSEMBLY__ */
+
+#endif /* ASM_FENTRY_H */
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 0525a8bdf65d..7df5477e26ec 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -1,6 +1,8 @@
 #ifndef _ASM_X86_FTRACE_H
 #define _ASM_X86_FTRACE_H
 
+#include <asm/fentry.h>
+
 #ifdef __ASSEMBLY__
 
 	/* skip is set if the stack was already partially adjusted */
@@ -35,11 +37,7 @@
 #endif
 
 #ifdef CONFIG_FUNCTION_TRACER
-#ifdef CC_USING_FENTRY
-# define MCOUNT_ADDR		((long)(__fentry__))
-#else
-# define MCOUNT_ADDR		((long)(mcount))
-#endif
+#define MCOUNT_ADDR		((long)(fentry_hook))
 #define MCOUNT_INSN_SIZE	5 /* sizeof mcount call */
 
 #ifdef CONFIG_DYNAMIC_FTRACE
@@ -47,9 +45,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
-extern void mcount(void);
 extern atomic_t modifying_ftrace_code;
-extern void __fentry__(void);
 
 static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 43bb38951660..a3616e0a4e6c 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -52,6 +52,7 @@
 #include <asm/hw_irq.h>
 #include <asm/page_types.h>
 #include <asm/irqflags.h>
+#include <asm/fentry.h>
 #include <asm/paravirt.h>
 #include <asm/ftrace.h>
 #include <asm/percpu.h>
@@ -71,17 +72,11 @@
 
 #ifdef CONFIG_FUNCTION_TRACER
 
-#ifdef CC_USING_FENTRY
-# define function_hook	__fentry__
-#else
-# define function_hook	mcount
-#endif
-
 #ifdef CONFIG_DYNAMIC_FTRACE
 
-ENTRY(function_hook)
+ENTRY(fentry_hook)
 	retq
-END(function_hook)
+END(fentry_hook)
 
 /* skip is set if stack has been adjusted */
 .macro ftrace_caller_setup skip=0
@@ -196,7 +191,7 @@ END(ftrace_regs_caller)
 
 #else /* ! CONFIG_DYNAMIC_FTRACE */
 
-ENTRY(function_hook)
+ENTRY(fentry_hook)
 	cmpl $0, function_trace_stop
 	jne  ftrace_stub
 
@@ -230,7 +225,7 @@ trace:
 	MCOUNT_RESTORE_FRAME
 
 	jmp ftrace_stub
-END(function_hook)
+END(fentry_hook)
 #endif /* CONFIG_DYNAMIC_FTRACE */
 #endif /* CONFIG_FUNCTION_TRACER */
 
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
index 040681928e9d..ba9878e6ee8f 100644
--- a/arch/x86/kernel/x8664_ksyms_64.c
+++ b/arch/x86/kernel/x8664_ksyms_64.c
@@ -10,15 +10,11 @@
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 #include <asm/desc.h>
-#include <asm/ftrace.h>
+#include <asm/fentry.h>
 
 #ifdef CONFIG_FUNCTION_TRACER
 /* mcount and __fentry__ are defined in assembly */
-#ifdef CC_USING_FENTRY
-EXPORT_SYMBOL(__fentry__);
-#else
-EXPORT_SYMBOL(mcount);
-#endif
+EXPORT_SYMBOL(fentry_hook);
 #endif
 
 EXPORT_SYMBOL(__get_user_1);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] fentry: x86, cleanup function_hook uses
  2014-04-29  7:24 ` [PATCH 2/2] fentry: x86, cleanup function_hook uses Jiri Slaby
@ 2014-04-29  7:28   ` H. Peter Anvin
  2014-04-29 10:47     ` [PATCH v2 " Jiri Slaby
  0 siblings, 1 reply; 5+ messages in thread
From: H. Peter Anvin @ 2014-04-29  7:28 UTC (permalink / raw)
  To: Jiri Slaby, rostedt
  Cc: jirislaby, linux-kernel, Thomas Gleixner, x86,
	Frederic Weisbecker, Ingo Molnar

On 04/29/2014 12:24 AM, Jiri Slaby wrote:
> Let's define fentry_hook depending on CC_USING_FENTRY and use that
> macro all over. This saves some #ifdef's here and there.

Any reason not to use the existing macro name function_hook?

(Valid reasons include "too generic".  However, please motivate in the
commit message.)

	-hpa


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] fentry: x86, cleanup function_hook uses
  2014-04-29  7:28   ` H. Peter Anvin
@ 2014-04-29 10:47     ` Jiri Slaby
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Slaby @ 2014-04-29 10:47 UTC (permalink / raw)
  To: rostedt
  Cc: jirislaby, linux-kernel, Jiri Slaby, Thomas Gleixner,
	H. Peter Anvin, x86, Frederic Weisbecker, Ingo Molnar

Let's define fentry_hook depending on CC_USING_FENTRY and use that
macro all over. This saves some #ifdef's here and there.

We do not use the old macro function_hook since it is too generic.
Hence we introduce fentry_hook which corresponds to what it is.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <x86@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
---
 arch/x86/include/asm/fentry.h    | 14 ++++++++++++++
 arch/x86/include/asm/ftrace.h    | 10 +++-------
 arch/x86/kernel/entry_64.S       | 15 +++++----------
 arch/x86/kernel/x8664_ksyms_64.c |  8 ++------
 4 files changed, 24 insertions(+), 23 deletions(-)
 create mode 100644 arch/x86/include/asm/fentry.h

diff --git a/arch/x86/include/asm/fentry.h b/arch/x86/include/asm/fentry.h
new file mode 100644
index 000000000000..febe8d272f0f
--- /dev/null
+++ b/arch/x86/include/asm/fentry.h
@@ -0,0 +1,14 @@
+#ifndef ASM_FENTRY_H
+#define ASM_FENTRY_H
+
+#ifdef CC_USING_FENTRY
+# define fentry_hook	__fentry__
+#else
+# define fentry_hook	mcount
+#endif
+
+#ifndef __ASSEMBLY__
+extern void fentry_hook(void);
+#endif /* __ASSEMBLY__ */
+
+#endif /* ASM_FENTRY_H */
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 0525a8bdf65d..7df5477e26ec 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -1,6 +1,8 @@
 #ifndef _ASM_X86_FTRACE_H
 #define _ASM_X86_FTRACE_H
 
+#include <asm/fentry.h>
+
 #ifdef __ASSEMBLY__
 
 	/* skip is set if the stack was already partially adjusted */
@@ -35,11 +37,7 @@
 #endif
 
 #ifdef CONFIG_FUNCTION_TRACER
-#ifdef CC_USING_FENTRY
-# define MCOUNT_ADDR		((long)(__fentry__))
-#else
-# define MCOUNT_ADDR		((long)(mcount))
-#endif
+#define MCOUNT_ADDR		((long)(fentry_hook))
 #define MCOUNT_INSN_SIZE	5 /* sizeof mcount call */
 
 #ifdef CONFIG_DYNAMIC_FTRACE
@@ -47,9 +45,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
-extern void mcount(void);
 extern atomic_t modifying_ftrace_code;
-extern void __fentry__(void);
 
 static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 43bb38951660..a3616e0a4e6c 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -52,6 +52,7 @@
 #include <asm/hw_irq.h>
 #include <asm/page_types.h>
 #include <asm/irqflags.h>
+#include <asm/fentry.h>
 #include <asm/paravirt.h>
 #include <asm/ftrace.h>
 #include <asm/percpu.h>
@@ -71,17 +72,11 @@
 
 #ifdef CONFIG_FUNCTION_TRACER
 
-#ifdef CC_USING_FENTRY
-# define function_hook	__fentry__
-#else
-# define function_hook	mcount
-#endif
-
 #ifdef CONFIG_DYNAMIC_FTRACE
 
-ENTRY(function_hook)
+ENTRY(fentry_hook)
 	retq
-END(function_hook)
+END(fentry_hook)
 
 /* skip is set if stack has been adjusted */
 .macro ftrace_caller_setup skip=0
@@ -196,7 +191,7 @@ END(ftrace_regs_caller)
 
 #else /* ! CONFIG_DYNAMIC_FTRACE */
 
-ENTRY(function_hook)
+ENTRY(fentry_hook)
 	cmpl $0, function_trace_stop
 	jne  ftrace_stub
 
@@ -230,7 +225,7 @@ trace:
 	MCOUNT_RESTORE_FRAME
 
 	jmp ftrace_stub
-END(function_hook)
+END(fentry_hook)
 #endif /* CONFIG_DYNAMIC_FTRACE */
 #endif /* CONFIG_FUNCTION_TRACER */
 
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
index 040681928e9d..ba9878e6ee8f 100644
--- a/arch/x86/kernel/x8664_ksyms_64.c
+++ b/arch/x86/kernel/x8664_ksyms_64.c
@@ -10,15 +10,11 @@
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 #include <asm/desc.h>
-#include <asm/ftrace.h>
+#include <asm/fentry.h>
 
 #ifdef CONFIG_FUNCTION_TRACER
 /* mcount and __fentry__ are defined in assembly */
-#ifdef CC_USING_FENTRY
-EXPORT_SYMBOL(__fentry__);
-#else
-EXPORT_SYMBOL(mcount);
-#endif
+EXPORT_SYMBOL(fentry_hook);
 #endif
 
 EXPORT_SYMBOL(__get_user_1);
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-29 10:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29  7:24 [PATCH 1/2] ftrace: PPC, fix obsolete comment Jiri Slaby
2014-04-29  7:24 ` Jiri Slaby
2014-04-29  7:24 ` [PATCH 2/2] fentry: x86, cleanup function_hook uses Jiri Slaby
2014-04-29  7:28   ` H. Peter Anvin
2014-04-29 10:47     ` [PATCH v2 " Jiri Slaby

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.