Re: RFC: Stack saving/tracing functionality.

From: Antoine Brodin (antoine.brodin_at_laposte.net)
Date: 06/10/05

  • Next message: Poul-Henning Kamp: "Re: RFC: Stack saving/tracing functionality."
    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"


  • Next message: Poul-Henning Kamp: "Re: RFC: Stack saving/tracing functionality."

    Relevant Pages