Skip to contentSkip to conversation

x86: don't use mcount in pvclock.c

PATCH In review Jeremy Fitzhardinge 2 participants 3 messages Sep 23, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: don't use mcount in pvclock.c

When using a paravirt clock, pvclock.c can be used by sched_clock(), which in turn is used by the tracing mechanism for timestamps, which leads to infinite recursion.

Disable mcount/tracing for pvclock.o.

arch/x86/kernel/Makefile +1 -0
index f3477bb..35b447c 100644
@@ -11,6 +11,7 @@ ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_tsc.o = -pg
 CFLAGS_REMOVE_rtc.o = -pg
 CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
+CFLAGS_REMOVE_pvclock.o = -pg
 CFLAGS_REMOVE_ftrace.o = -pg
 CFLAGS_REMOVE_early_printk.o = -pg
 endif
#1 lore raw

Crap!

I fixed this back on 7/1/2010 from a RHEL bugzilla report, and forgot to push it mainline. This also requires kvmclock.o to have the -pg as well.

I'll add your patch and add the kvmclock.o too.

Thanks,

-- Steve

Quoted 22 lines · Jeremy Fitzhardinge

When using a paravirt clock, pvclock.c can be used by sched_clock(), which in turn is used by the tracing mechanism for timestamps, which leads to infinite recursion.

Disable mcount/tracing for pvclock.o.

arch/x86/kernel/Makefile +1 -0
index f3477bb..35b447c 100644
@@ -11,6 +11,7 @@ ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_tsc.o = -pg
 CFLAGS_REMOVE_rtc.o = -pg
 CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
+CFLAGS_REMOVE_pvclock.o = -pg
 CFLAGS_REMOVE_ftrace.o = -pg
 CFLAGS_REMOVE_early_printk.o = -pg
 endif
#2 lore raw

[tip:perf/urgent] tracing/x86: Don't use mcount in pvclock.c

In reply to Jeremy Fitzhardinge
Commit-ID:  9ecd4e1689208afe9b059a5ce1333acb2f42c4d2
Gitweb:     http://git.kernel.org/tip/9ecd4e1689208afe9b059a5ce1333acb2f42c4d2
Author:     Jeremy Fitzhardinge <[email protected]>
AuthorDate: Wed, 22 Sep 2010 17:07:27 -0700
Committer:  Steven Rostedt <[email protected]>
CommitDate: Wed, 22 Sep 2010 23:00:50 -0400

tracing/x86: Don't use mcount in pvclock.c

When using a paravirt clock, pvclock.c can be used by sched_clock(), which in turn is used by the tracing mechanism for timestamps, which leads to infinite recursion.

Disable mcount/tracing for pvclock.o.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/Makefile +1 -0
index 0925676..882bbff 100644
@@ -11,6 +11,7 @@ ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_tsc.o = -pg
 CFLAGS_REMOVE_rtc.o = -pg
 CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
+CFLAGS_REMOVE_pvclock.o = -pg
 CFLAGS_REMOVE_ftrace.o = -pg
 CFLAGS_REMOVE_early_printk.o = -pg
 endif