Re: RFC: Stack saving/tracing functionality.
From: Antoine Brodin (antoine.brodin_at_laposte.net)
Date: 06/10/05
- Previous message: Jeff Roberson: "Re: RFC: Stack saving/tracing functionality."
- In reply to: Poul-Henning Kamp: "Re: RFC: Stack saving/tracing functionality."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 10 Jun 2005 23:32:54 +0200 To: "Poul-Henning Kamp" <phk@phk.freebsd.dk>
"Poul-Henning Kamp" <phk@phk.freebsd.dk> wrote:
> In message <20050608221829.75c2de12.antoine.brodin@laposte.net>, Antoine Brodin writes:
> >Hi,
> >
> >
> >With Jeff@'s help, I implemented stack saving/tracing functionality.
>
> Thankyou!
>
> >Another question: Since the stack saving/tracing functionality depends
> >on ddb, should kern/subr_stack.c be moved to ddb/stack.c and
> >sys/stack.h to ddb/stack.h?
>
> No.
>
> This code should be compiled in as standard so that any panic prints
> a stacktrace on the console, also for non-KDB kernels.
I put the MD code in <arch>/<arch>/db_trace.c to avoid the duplication
of some structure declarations like i386_frame, or the definition of the
INKERNEL macro.
Should I move these to something like <arch>/include/frame.h and put
stack_save in its own file (this function is around 20 lines per arch) ?
> A sysctl to enable grepping a backtrace from core-dumping processes
> would be wonderful as well.
It isn't possible to backtrace processes while they're in userland yet,
and I'm not sure it would be safe (one could corrupt its own stack to
try to confuse the kernel) and useful (gdb handles core dumps very
well).
But you can grab the end of life of the process in the kernel like:
%%%
#0 0xc04d712c at sigexit+0xfc
#1 0xc04d6d9c at postsig+0x19c
#2 0xc04f8fc8 at ast+0x4d8
#3 0xc061726d at doreti_ast+0x17
%%%
I don't know if this is what you were looking for ?
An updated patch with a correction in the alpha case is at:
http://bsd.miki.eu.org/~antoine/stack/stack-06-10.diff
Cheers,
Antoine
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Jeff Roberson: "Re: RFC: Stack saving/tracing functionality."
- In reply to: Poul-Henning Kamp: "Re: RFC: Stack saving/tracing functionality."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- miibus, ed0, and the realpath security advisory
... dmesg and kernel config below. ... miibus0: <MII bus> on dc0 ...
sc0: <System console> on isa0 ... # The `bpf' pseudo-device enables the Berkeley
Packet Filter. ... (freebsd-questions) - [parisc] 2.6.24-rc3 (64-bit, smp) fails to boot on 9000/785/J5600
... v2.6.24-rc3-19-g2ffbb83 fails very early in the boot procedure. ... kernel
was compiled using gcc 4.1.2. ... you may need to switch your console. ... # IPVS
transport protocol load balancing support ... (Linux-Kernel) - [parisc] 2.6.24-rc3 (64-bit, smp) fails to boot on 9000/785/J5600
... v2.6.24-rc3-19-g2ffbb83 fails very early in the boot procedure. ... kernel
was compiled using gcc 4.1.2. ... you may need to switch your console. ... # IPVS
transport protocol load balancing support ... (Linux-Kernel) - Re: OpenGL-based framebuffer concepts
... are the best drivers we have. ... you forget everytime that the kernel
... Apparently with any framebuffer driver ... framebuffer graphics apps in the
console except that I can't ... (Linux-Kernel) - Root device (HP Smart Array) not found with cciss (also: panic= not always working?)
... relative newbie with kernel building). ... I have no console or remote
console). ... and the running Debian kernel has the ... At some point I also got
the following boot output (this time from my ... (comp.os.linux.hardware)