aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 15:21:15 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 16:34:56 -0400
commit74f4e369fc5b52433ad824cef32d3bf1304549be (patch)
treec70d073a2740821f52d8b2b09f01626a06201e74
parent5b82a1b08a00b2adca3d9dd9777efff40b7aaaa1 (diff)
ftrace: stacktrace fix
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/linux/ftrace.h8
-rw-r--r--kernel/semaphore.c2
-rw-r--r--kernel/trace/trace.c4
-rw-r--r--kernel/trace/trace.h2
4 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 0d3714e7110b..017ab44d572a 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -120,4 +120,12 @@ static inline void tracer_disable(void)
120# define trace_preempt_off(a0, a1) do { } while (0) 120# define trace_preempt_off(a0, a1) do { } while (0)
121#endif 121#endif
122 122
123#ifdef CONFIG_CONTEXT_SWITCH_TRACER
124extern void
125ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
126#else
127static inline void
128ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
129#endif
130
123#endif /* _LINUX_FTRACE_H */ 131#endif /* _LINUX_FTRACE_H */
diff --git a/kernel/semaphore.c b/kernel/semaphore.c
index 5c2942e768cd..1a064adab658 100644
--- a/kernel/semaphore.c
+++ b/kernel/semaphore.c
@@ -31,6 +31,7 @@
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/semaphore.h> 32#include <linux/semaphore.h>
33#include <linux/spinlock.h> 33#include <linux/spinlock.h>
34#include <linux/ftrace.h>
34 35
35static noinline void __down(struct semaphore *sem); 36static noinline void __down(struct semaphore *sem);
36static noinline int __down_interruptible(struct semaphore *sem); 37static noinline int __down_interruptible(struct semaphore *sem);
@@ -53,6 +54,7 @@ void down(struct semaphore *sem)
53{ 54{
54 unsigned long flags; 55 unsigned long flags;
55 56
57 ftrace_special(sem->count, 0, __LINE__);
56 spin_lock_irqsave(&sem->lock, flags); 58 spin_lock_irqsave(&sem->lock, flags);
57 if (likely(sem->count > 0)) 59 if (likely(sem->count > 0))
58 sem->count--; 60 sem->count--;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2824cf48cdca..3271916ff033 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -901,7 +901,7 @@ tracing_sched_switch_trace(struct trace_array *tr,
901 entry->ctx.next_pid = next->pid; 901 entry->ctx.next_pid = next->pid;
902 entry->ctx.next_prio = next->prio; 902 entry->ctx.next_prio = next->prio;
903 entry->ctx.next_state = next->state; 903 entry->ctx.next_state = next->state;
904 __trace_stack(tr, data, flags, 4); 904 __trace_stack(tr, data, flags, 5);
905 __raw_spin_unlock(&data->lock); 905 __raw_spin_unlock(&data->lock);
906 raw_local_irq_restore(irq_flags); 906 raw_local_irq_restore(irq_flags);
907} 907}
@@ -927,7 +927,7 @@ tracing_sched_wakeup_trace(struct trace_array *tr,
927 entry->ctx.next_pid = wakee->pid; 927 entry->ctx.next_pid = wakee->pid;
928 entry->ctx.next_prio = wakee->prio; 928 entry->ctx.next_prio = wakee->prio;
929 entry->ctx.next_state = wakee->state; 929 entry->ctx.next_state = wakee->state;
930 __trace_stack(tr, data, flags, 5); 930 __trace_stack(tr, data, flags, 6);
931 __raw_spin_unlock(&data->lock); 931 __raw_spin_unlock(&data->lock);
932 raw_local_irq_restore(irq_flags); 932 raw_local_irq_restore(irq_flags);
933 933
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index f5de0601b408..c460e85e94ed 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -51,7 +51,7 @@ struct special_entry {
51 * Stack-trace entry: 51 * Stack-trace entry:
52 */ 52 */
53 53
54#define FTRACE_STACK_ENTRIES 5 54#define FTRACE_STACK_ENTRIES 8
55 55
56struct stack_entry { 56struct stack_entry {
57 unsigned long caller[FTRACE_STACK_ENTRIES]; 57 unsigned long caller[FTRACE_STACK_ENTRIES];