From: Daniel Walker <dwalker@mvista.com>
To: mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH -rt] show_held_locks cleanup
Date: Fri, 12 May 2006 10:12:17 -0700 [thread overview]
Message-ID: <200605121712.k4CHCHXG011893@dwalker1.mvista.com> (raw)
- 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 <dwalker@mvista.com>
Index: linux-2.6.16/kernel/mutex-debug.c
===================================================================
--- linux-2.6.16.orig/kernel/mutex-debug.c
+++ 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);
Index: linux-2.6.16/arch/arm/kernel/traps.c
===================================================================
--- linux-2.6.16.orig/arch/arm/kernel/traps.c
+++ 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
}
Index: linux-2.6.16/arch/x86_64/kernel/traps.c
===================================================================
--- linux-2.6.16.orig/arch/x86_64/kernel/traps.c
+++ 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)
Index: linux-2.6.16/arch/i386/kernel/traps.c
===================================================================
--- linux-2.6.16.orig/arch/i386/kernel/traps.c
+++ 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);
}
next reply other threads:[~2006-05-12 17:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-12 17:12 Daniel Walker [this message]
2006-05-20 15:50 ` Daniel Walker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200605121712.k4CHCHXG011893@dwalker1.mvista.com \
--to=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®