Skip to contentSkip to conversation

sched: mark sched_clock() as notrace

PATCH In review Mike Frysinger 1 participant 2 messages Dec 10, 2009 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: mark sched_clock() as notrace

The core ftrace code (trace_clock_local) calls sched_clock() directly, so we don't want to recurisvely trigger the ftrace code. Rather than update every sched_clock() definition, tag the prototype for everyone as notrace.

---
 include/linux/sched.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/sched.h +2 -1
index 89115ec..3f4fa73 100644
@@ -1840,7 +1840,8 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
 extern int sched_clock_stable;
 #endif
 
-extern unsigned long long sched_clock(void);
+/* ftrace calls sched_clock() directly */
+extern unsigned long long notrace sched_clock(void);
 
 extern void sched_clock_init(void);
 extern u64 sched_clock_cpu(int cpu);
Signature · 1 line
1.6.5.5
#1 lore raw

[tip:perf/urgent] sched: Mark sched_clock() as notrace

Commit-ID:  1bbfa6f25673019dc0acc9308b667c96f6cda8bf
Gitweb:     http://git.kernel.org/tip/1bbfa6f25673019dc0acc9308b667c96f6cda8bf
Author:     Mike Frysinger <[email protected]>
AuthorDate: Wed, 9 Dec 2009 20:07:03 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 10 Dec 2009 08:30:27 +0100

sched: Mark sched_clock() as notrace

The core ftrace code (trace_clock_local) calls sched_clock() directly, so we don't want to recurisvely trigger the ftrace code. Rather than update every sched_clock() definition, tag the prototype for everyone as notrace.

LKML-Reference: <[email protected]>

---
 include/linux/sched.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/sched.h +2 -1
index 75e6e60..576d838 100644
@@ -1836,7 +1836,8 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
 extern int sched_clock_stable;
 #endif
 
-extern unsigned long long sched_clock(void);
+/* ftrace calls sched_clock() directly */
+extern unsigned long long notrace sched_clock(void);
 
 extern void sched_clock_init(void);
 extern u64 sched_clock_cpu(int cpu);