Skip to contentSkip to conversation

show_held_locks cleanup

PATCH In review Daniel Walker 1 participant 2 messages May 12, 2006 – May 20, 2006 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

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.

kernel/mutex-debug.c +4 -4
Index: linux-2.6.16/kernel/mutex-debug.c
===================================================================
@@ -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
Index: linux-2.6.16/arch/arm/kernel/traps.c
===================================================================
@@ -176,9 +176,12 @@ static void dump_backtrace(struct pt_reg
 void 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
Index: linux-2.6.16/arch/x86_64/kernel/traps.c
===================================================================
@@ -255,6 +255,8 @@ void show_trace(struct task_struct *task
 #undef HANDLE_STACK
 	printk("\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
Index: linux-2.6.16/arch/i386/kernel/traps.c
===================================================================
@@ -175,6 +175,7 @@ static void show_trace_log_lvl(struct ta
 		printk(" =======================\n");
 	}
 	print_traces(task);
+	mutex_debug_show_held_locks(task);
 	rt_mutex_show_held_locks(task, 1);
 }
 
#1 lore raw

You didn't like this one ?

Quoted 7 lines · Daniel Walker

- 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.