From: Ingo Molnar <mingo@elte.hu>
To: Jiri Kosina <jikos@jikos.cz>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] let WARN_ON() output the condition
Date: Wed, 6 Dec 2006 10:27:15 +0100 [thread overview]
Message-ID: <20061206092714.GA31980@elte.hu> (raw)
In-Reply-To: <Pine.LNX.4.64.0612061008370.28502@twin.jikos.cz>
* Jiri Kosina <jikos@jikos.cz> wrote:
> On Wed, 6 Dec 2006, Ingo Molnar wrote:
>
> > i'll probably ack such a patch, it can be useful even when the line
> > number is unique: if someone reports a WARN_ON() from an old kernel i
> > dont have to dig up the exact source but can see it right from the
> > condition what happened. Useful redundancy in bug output can be quite
> > useful at times. Please post it and we'll see whether it's acceptable.
>
> OK, thanks, I will send it later today.
>
> BTW I still don't see how to distinguish it easily ... for example:
>
> WARNING at kernel/mutex.c:132 __mutex_lock_common()
> [<c0103d70>] dump_trace+0x68/0x1b5
> [<c0103ed5>] show_trace_log_lvl+0x18/0x2c
> [<c010445b>] show_trace+0xf/0x11
> [<c01044cd>] dump_stack+0x12/0x14
> [<c037523f>] __mutex_lock_slowpath+0xc6/0x261
> [<c0199c61>] create_dir+0x24/0x1ba
> [<c019a30b>] sysfs_create_dir+0x45/0x5f
> [<c01f302b>] kobject_add+0xd6/0x18d
> [<c01f31fb>] kobject_register+0x19/0x30
> [<c02e771a>] md_probe+0x11a/0x124
> [<c0267fa4>] kobj_lookup+0xe6/0x122
> [<c01ec12e>] get_gendisk+0xe/0x1b
> [<c018590e>] do_open+0x2e/0x298
> [<c0185d0f>] blkdev_open+0x25/0x4d
> [<c016451b>] __dentry_open+0xc3/0x17e
> [<c0164650>] nameidata_to_filp+0x24/0x33
> [<c0164691>] do_filp_open+0x32/0x39
> [<c01646da>] do_sys_open+0x42/0xbe
> [<c016478f>] sys_open+0x1c/0x1e
> [<c0102dbc>] syscall_call+0x7/0xb
>
> How can you see immediately which one of the two WARN_ONs in
> spin_lock_mutex() triggered?
yeah, i can tell that even without assembly or gdb, just from the
offset:
> [<c037523f>] __mutex_lock_slowpath+0xc6/0x261
there are 4 WARN_ON()s in __mutex_lock_slowpath(), distributed roughly
equally. Which makes the above one the second out of the four
WARN_ON()s, i.e.:
DEBUG_LOCKS_WARN_ON(l->magic != l); \
Did i get it right? (but then again i guess i've got an unfair advantage
in interpreting locking related bug messages ;-)
but it can also be told semantically, it cannot be the in_interrupt()
assert because this is clearly not IRQ context:
> [<c037523f>] __mutex_lock_slowpath+0xc6/0x261
> [<c0199c61>] create_dir+0x24/0x1ba
> [<c019a30b>] sysfs_create_dir+0x45/0x5f
but in such cases i'd rather suggest the use of inline functions instead
of macros and then it's a simple gdb lookup to figure out the call site.
So, which clown added that macro to mutex-debug.h ... oh, never mind.
Ingo
next prev parent reply other threads:[~2006-12-06 9:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-06 0:51 [PATCH] let WARN_ON() output the condition Jiri Kosina
2006-12-06 1:27 ` Andrew Morton
2006-12-06 12:52 ` Horst H. von Brand
2006-12-06 13:54 ` Ingo Molnar
2006-12-06 14:35 ` Jaswinder Singh
2006-12-06 15:08 ` Jiri Kosina
2006-12-06 8:37 ` Ingo Molnar
2006-12-06 8:47 ` Jiri Kosina
2006-12-06 8:54 ` Ingo Molnar
2006-12-06 9:04 ` Jiri Kosina
2006-12-06 9:07 ` Ingo Molnar
2006-12-06 9:11 ` Jiri Kosina
2006-12-06 9:27 ` Ingo Molnar [this message]
2006-12-06 9:14 ` Jan Engelhardt
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=20061206092714.GA31980@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=jikos@jikos.cz \
--cc=linux-kernel@vger.kernel.org \
/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