Loading include/linux/ftrace.h +8 −0 Original line number Diff line number Diff line Loading @@ -120,4 +120,12 @@ static inline void tracer_disable(void) # define trace_preempt_off(a0, a1) do { } while (0) #endif #ifdef CONFIG_CONTEXT_SWITCH_TRACER extern void ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); #else static inline void ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } #endif #endif /* _LINUX_FTRACE_H */ kernel/semaphore.c +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <linux/sched.h> #include <linux/semaphore.h> #include <linux/spinlock.h> #include <linux/ftrace.h> static noinline void __down(struct semaphore *sem); static noinline int __down_interruptible(struct semaphore *sem); Loading @@ -53,6 +54,7 @@ void down(struct semaphore *sem) { unsigned long flags; ftrace_special(sem->count, 0, __LINE__); spin_lock_irqsave(&sem->lock, flags); if (likely(sem->count > 0)) sem->count--; Loading kernel/trace/trace.c +2 −2 Original line number Diff line number Diff line Loading @@ -901,7 +901,7 @@ tracing_sched_switch_trace(struct trace_array *tr, entry->ctx.next_pid = next->pid; entry->ctx.next_prio = next->prio; entry->ctx.next_state = next->state; __trace_stack(tr, data, flags, 4); __trace_stack(tr, data, flags, 5); __raw_spin_unlock(&data->lock); raw_local_irq_restore(irq_flags); } Loading @@ -927,7 +927,7 @@ tracing_sched_wakeup_trace(struct trace_array *tr, entry->ctx.next_pid = wakee->pid; entry->ctx.next_prio = wakee->prio; entry->ctx.next_state = wakee->state; __trace_stack(tr, data, flags, 5); __trace_stack(tr, data, flags, 6); __raw_spin_unlock(&data->lock); raw_local_irq_restore(irq_flags); Loading kernel/trace/trace.h +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ struct special_entry { * Stack-trace entry: */ #define FTRACE_STACK_ENTRIES 5 #define FTRACE_STACK_ENTRIES 8 struct stack_entry { unsigned long caller[FTRACE_STACK_ENTRIES]; Loading Loading
include/linux/ftrace.h +8 −0 Original line number Diff line number Diff line Loading @@ -120,4 +120,12 @@ static inline void tracer_disable(void) # define trace_preempt_off(a0, a1) do { } while (0) #endif #ifdef CONFIG_CONTEXT_SWITCH_TRACER extern void ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); #else static inline void ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } #endif #endif /* _LINUX_FTRACE_H */
kernel/semaphore.c +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <linux/sched.h> #include <linux/semaphore.h> #include <linux/spinlock.h> #include <linux/ftrace.h> static noinline void __down(struct semaphore *sem); static noinline int __down_interruptible(struct semaphore *sem); Loading @@ -53,6 +54,7 @@ void down(struct semaphore *sem) { unsigned long flags; ftrace_special(sem->count, 0, __LINE__); spin_lock_irqsave(&sem->lock, flags); if (likely(sem->count > 0)) sem->count--; Loading
kernel/trace/trace.c +2 −2 Original line number Diff line number Diff line Loading @@ -901,7 +901,7 @@ tracing_sched_switch_trace(struct trace_array *tr, entry->ctx.next_pid = next->pid; entry->ctx.next_prio = next->prio; entry->ctx.next_state = next->state; __trace_stack(tr, data, flags, 4); __trace_stack(tr, data, flags, 5); __raw_spin_unlock(&data->lock); raw_local_irq_restore(irq_flags); } Loading @@ -927,7 +927,7 @@ tracing_sched_wakeup_trace(struct trace_array *tr, entry->ctx.next_pid = wakee->pid; entry->ctx.next_prio = wakee->prio; entry->ctx.next_state = wakee->state; __trace_stack(tr, data, flags, 5); __trace_stack(tr, data, flags, 6); __raw_spin_unlock(&data->lock); raw_local_irq_restore(irq_flags); Loading
kernel/trace/trace.h +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ struct special_entry { * Stack-trace entry: */ #define FTRACE_STACK_ENTRIES 5 #define FTRACE_STACK_ENTRIES 8 struct stack_entry { unsigned long caller[FTRACE_STACK_ENTRIES]; Loading