show_held_locks cleanup
PATCH 1/1 show_held_locks cleanup
- turns show_held_locks into debug_mutex_show_held_locks() .
- Adds debug_mutex_show_held_locks() + rt_mutex_show_held_locks() to x86_64
- cleans up show_held_locks() on arm .
I compile tested i386, arm, not x86_64 . Seems like this should go upstream too.
Signed-off-by Daniel Walker <[email protected]>
kernel/mutex-debug.c +4 -4
@@ -117,7 +117,7 @@ static void show_task_locks(struct task_* printk all locks held in the system (if filter == NULL), * or all locks belonging to a single task (if filter != NULL): */ -void show_held_locks (struct task_struct *filter) +void mutex_debug_show_held_locks (struct task_struct *filter) {struct list_head *curr, *cursor =NULL ;struct mutex *lock;
@@ -201,7 +201,7 @@ retry: }while_each_thread (g, p);printk ("\n" ); -show_held_locks (NULL ); +mutex_debug_show_held_locks (NULL );printk ("=============================================\n\n" );if (unlock)
@@ -216,7 +216,7 @@ static void report_deadlock(struct task_printk_lock (lock,1 );printk ("... trying at: " );print_symbol ("%s\n" , ip); -show_held_locks (current); +mutex_debug_show_held_locks (current);if (lockblk) { printk("but %s/%d is deadlocking current task %s/%d!\n\n",
@@ -225,7 +225,7 @@ static void report_deadlock(struct task_ task->comm, task->pid);printk_lock (lockblk,1 ); -show_held_locks (task); +mutex_debug_show_held_locks (task);printk ("\n%s/%d's [blocked] stackdump:\n\n" , task->comm, task->pid);
arch/arm/kernel/traps.c +5 -2
@@ -176,9 +176,12 @@ static void dump_backtrace(struct pt_regvoid dump_stack (void ) {#ifdef CONFIG_DEBUG_ERRORS +struct task_struct *task = current; +__backtrace (); -print_traces (current); -show_held_locks (current); +print_traces (task); +mutex_debug_show_held_locks (task); +rt_mutex_show_held_locks (task,1 );#endif }
arch/x86_64/kernel/traps.c +2 -0
@@ -255,6 +255,8 @@ void show_trace(struct task_struct *task#undef HANDLE_STACKprintk ("\n" );print_traces (task); +mutex_debug_show_held_locks (task); +rt_mutex_show_held_locks (task,1 ); }void show_stack (struct task_struct *tsk,unsigned long * rsp)
arch/i386/kernel/traps.c +1 -0
@@ -175,6 +175,7 @@ static void show_trace_log_lvl(struct taprintk (" =======================\n" ); }print_traces (task); +mutex_debug_show_held_locks (task);rt_mutex_show_held_locks (task,1 ); }
You didn't like this one ?
Quoted 7 lines · Daniel Walker
- turns
show_held_locksintodebug_mutex_show_held_locks().
- Addsdebug_mutex_show_held_locks()+rt_mutex_show_held_locks()tox86_64
- cleans upshow_held_locks()on arm .I compile tested i386, arm, not
x86_64. Seems like this should go upstream too.Signed-off-by Daniel Walker <[email protected]>