From: Herbert Poetzl <herbert@13thfloor.at>
To: Nick Warne <nick@linicks.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kswapd0 oops -> debug information
Date: Sun, 2 Jan 2005 08:41:12 +0100 [thread overview]
Message-ID: <20050102074112.GA31709@mail.13thfloor.at> (raw)
In-Reply-To: <200411271721.21847.nick@linicks.net>
On Sat, Nov 27, 2004 at 05:21:21PM +0000, Nick Warne wrote:
> On Saturday 27 November 2004 17:01, Randy.Dunlap wrote:
>
> > kernel version?
>
> Heh. My great debug attempt, eh?
>
> kernel 2.6.9
>
> > .config file?
> > full oops message, with stack backtrace?
> > The stack backtrace could tell us who a bad caller is.
> > It can just be a caller's problem, not a bug in (this)
> > one isolated function.
>
> http://linicks.net/kdebug/
>
> > Did you read/check linux/REPORTING-BUGS ?
>
> Yes, but wanted to try and learn myself on what was going on, rather than push
> the onus onto other people.
>
> The book I have re the make /dir/file.s states that it will produce assembler
> with _line_ numbers to corresponding C code. That is where I got lost, as it
> doesn't.
hmm, sorry for the late reply, but better late
than not at all ...
if you do
make fs/file.s V=1
you'll see what make actually does to compile
the source code into assembler code ...
make -f scripts/Makefile.build obj=scripts/basic
make -f scripts/Makefile.build obj=scripts
make -f scripts/Makefile.build obj=fs fs/file.s
gcc -Wp,-MD,fs/.file.s.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -fomit-frame-pointer -g -pipe -msoft-float -mpreferred-stack-boundary=2 -march=i586 -Iinclude/asm-i386/mach-default -DKBUILD_BASENAME=file -DKBUILD_MODNAME=file -S -o fs/file.s fs/file.c
and if that final gcc command does include a -g
(which can be controlled by CONFIG_DEBUG_INFO, or
simply added by hand), then the output will contain
lines like this:
.loc 1 45 0
.loc 1 46 0
which reference the file and line number in the
source code. files are 'declared' with lines:
.file "file.c"
.file 1 "fs/file.c"
.file 2 "include/linux/posix_types.h"
so you can pretty easy find the code in the
source. a different, but sometimes easier approach
is to use 'addr2line' on the kernel binary (if it
was compiled with CONFIG_DEBUG_INFO) to get the
source line from a kernel address ...
addr2line -e vmlinux c0123456
HTH,
Herbert
> Thanks,
>
> Nick.
>
> --
> "When you're chewing on life's gristle,
> Don't grumble, Give a whistle..."
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2005-01-02 7:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-27 13:11 kswapd0 oops -> debug information Nick Warne
2004-11-27 17:01 ` Randy.Dunlap
2004-11-27 17:21 ` Nick Warne
2005-01-02 7:41 ` Herbert Poetzl [this message]
2005-01-02 11:01 ` Nick Warne
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=20050102074112.GA31709@mail.13thfloor.at \
--to=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=nick@linicks.net \
/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