Commit 53e9ba17 authored by Thomas Gleixner's avatar Thomas Gleixner

sched: Add lock_count to task struct

Debugging interface.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 8741e875
...@@ -1395,6 +1395,26 @@ struct task_struct { ...@@ -1395,6 +1395,26 @@ struct task_struct {
gfp_t lockdep_reclaim_gfp; gfp_t lockdep_reclaim_gfp;
#endif #endif
/* realtime bits */
#define MAX_PREEMPT_TRACE 25
#define MAX_LOCK_STACK MAX_PREEMPT_TRACE
#ifdef CONFIG_DEBUG_PREEMPT
int lock_count;
# ifdef CONFIG_PREEMPT_RT
struct rt_mutex *owned_lock[MAX_LOCK_STACK];
# endif
#endif
#ifdef CONFIG_DETECT_SOFTLOCKUP
unsigned long softlockup_count; /* Count to keep track how long the
* thread is in the kernel without
* sleeping.
*/
#endif
#ifdef CONFIG_DEBUG_RT_MUTEXES
void *last_kernel_lock;
#endif
/* journalling filesystem info */ /* journalling filesystem info */
void *journal_info; void *journal_info;
......
...@@ -911,6 +911,9 @@ static void rt_mutex_init_task(struct task_struct *p) ...@@ -911,6 +911,9 @@ static void rt_mutex_init_task(struct task_struct *p)
#ifdef CONFIG_RT_MUTEXES #ifdef CONFIG_RT_MUTEXES
plist_head_init_atomic(&p->pi_waiters, &p->pi_lock); plist_head_init_atomic(&p->pi_waiters, &p->pi_lock);
p->pi_blocked_on = NULL; p->pi_blocked_on = NULL;
# ifdef CONFIG_DEBUG_RT_MUTEXES
p->last_kernel_lock = NULL;
# endif
#endif #endif
} }
...@@ -1123,6 +1126,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, ...@@ -1123,6 +1126,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
retval = copy_thread(clone_flags, stack_start, stack_size, p, regs); retval = copy_thread(clone_flags, stack_start, stack_size, p, regs);
if (retval) if (retval)
goto bad_fork_cleanup_io; goto bad_fork_cleanup_io;
#ifdef CONFIG_DEBUG_PREEMPT
p->lock_count = 0;
#endif
if (pid != &init_struct_pid) { if (pid != &init_struct_pid) {
retval = -ENOMEM; retval = -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment