From: Sebastian Siewior <bigeasy@linutronix.de>
To: Ingo Molnar <mingo@redhat.com>
Cc: Greg Ungerer <gerg@uclinux.org>,
uclinux-dev@uclinux.org, linux-kernel@vger.kernel.org,
Sebastian Siewior <bigeasy@linutronix.de>
Subject: [PATCH] m68knommu: add FTRACE support
Date: Tue, 13 May 2008 18:52:43 +0200 [thread overview]
Message-ID: <1210697565-3106-2-git-send-email-bigeasy@linutronix.de> (raw)
In-Reply-To: <1210697565-3106-1-git-send-email-bigeasy@linutronix.de>
due to a gcc bug or feature, the following patch has to be applied to gcc:
|m68k: remove label generation on -pg
|
|haven't found a reason why this flag is needed. Maybe glibc needs this label.
|However this implementation puts the labels too far away.
|
|Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
|
|--- a/gcc/config/m68k/linux.h
|+++ b/gcc/config/m68k/linux.h
|@@ -143,7 +143,6 @@ along with GCC; see the file COPYING3.
| #undef FUNCTION_PROFILER
| #define FUNCTION_PROFILER(FILE, LABELNO) \
| { \
|- asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \
| if (flag_pic) \
| fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \
| else \
|--- a/gcc/config/m68k/m68k.h
|+++ b/gcc/config/m68k/m68k.h
|@@ -576,7 +576,7 @@ extern enum reg_class regno_reg_class[];
| #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
|
| #define FUNCTION_PROFILER(FILE, LABELNO) \
|- asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjsr mcount\n", (LABELNO))
|+ asm_fprintf (FILE, "\tjsr mcount\n", (LABELNO))
|
| #define EXIT_IGNORE_STACK 1
|
GCC bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36047
Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
---
arch/m68knommu/Kconfig | 1 +
arch/m68knommu/kernel/process.c | 2 +
arch/m68knommu/platform/coldfire/entry.S | 33 ++++++++++++++++++++++++++++++
kernel/trace/Kconfig | 2 +-
4 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 07eb4c4..90ce97b 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -166,6 +166,7 @@ config M527x
config COLDFIRE
bool
depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M532x || M5407)
+ select HAVE_FTRACE
default y
config CLOCK_SET
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 47502d5..57678a5 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -74,7 +74,9 @@ void cpu_idle(void)
{
/* endless idle loop with no priority at all */
while (1) {
+ stop_critical_timings();
idle();
+ start_critical_timings();
preempt_enable_no_resched();
schedule();
preempt_disable();
diff --git a/arch/m68knommu/platform/coldfire/entry.S b/arch/m68knommu/platform/coldfire/entry.S
index 111b66d..0301a80 100644
--- a/arch/m68knommu/platform/coldfire/entry.S
+++ b/arch/m68knommu/platform/coldfire/entry.S
@@ -55,6 +55,39 @@ sw_usp:
.globl inthandler
.globl fasthandler
+#ifdef CONFIG_FTRACE
+ENTRY(_mcount)
+ linkw %fp, #0
+
+ moveal ftrace_trace_function, %a0
+ movel #ftrace_stub, %d0
+ cmpl %a0@, %d0
+
+ bnew do_mcount
+
+ unlk %fp
+ rts
+
+do_mcount:
+
+ movel %fp, %d0
+ moveal %d0, %a1
+
+ moveal %a1@, %a0
+ movel %a0@(4), %sp@- /* push parent ip */
+ movel %a1@(4), %sp@- /* push ip */
+
+ moveal ftrace_trace_function, %a0
+ jsr %a0@
+
+ unlk %fp
+
+.globl ftrace_stub
+ftrace_stub:
+ rts
+END(mcount)
+#endif
+
enosys:
mov.l #sys_ni_syscall,%d3
bra 1f
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index c93446e..deaa9a5 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -101,7 +101,7 @@ config CONTEXT_SWITCH_TRACER
config DYNAMIC_FTRACE
bool "enable/disable ftrace tracepoints dynamically"
- depends on FTRACE
+ depends on FTRACE && !COLDFIRE
default y
help
This option will modify all the calls to ftrace dynamically
--
1.5.4.3
next prev parent reply other threads:[~2008-05-13 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 16:52 [RFC / PATCH] ftrace support on m68knommu Sebastian Siewior
2008-05-13 16:52 ` Sebastian Siewior [this message]
2008-05-16 13:02 ` [PATCH] m68knommu: add FTRACE support Steven Rostedt
2008-05-13 16:52 ` [PATCH] m68knommu: add read_barrier_depends() and irqs_disabled_flags() Sebastian Siewior
2008-05-13 16:52 ` [PATCH] ftrace: also dump the entry->flag field Sebastian Siewior
2008-05-16 12:59 ` [RFC / PATCH] ftrace support on m68knommu Steven Rostedt
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=1210697565-3106-2-git-send-email-bigeasy@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=gerg@uclinux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=uclinux-dev@uclinux.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).