Date: Sat, 18 Sep 2010 22:35:48 +0200 From: Attilio Rao <attilio@freebsd.org> To: Andriy Gapon <avg@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: KDB_TRACE and no backend Message-ID: <AANLkTimuiBG4nL4o%2BJ%2BKM6%2B9QdkRwwEsWnbC-tsoNO54@mail.gmail.com> In-Reply-To: <4C95214A.3070600@freebsd.org> References: <4C94A138.8050905@icyb.net.ua> <AANLkTingR6k6xdQJ3cZH8EkJeCWnq5vzeEjGHNaDv8AT@mail.gmail.com> <4C9507D1.3010008@icyb.net.ua> <4C950C48.6020600@freebsd.org> <4C95214A.3070600@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
2010/9/18 Andriy Gapon <avg@freebsd.org>:
> on 18/09/2010 22:00 Andriy Gapon said the following:
>> Oh, wow, and I totally overlooked stack_print().
>> Should have read stack(9) from the start.
>
> New patch. Hope this is better.
> I don't like that the printf is duplicated, but couldn't figure out a way to
> combine pre-processor and C conditions.
>
> --- a/sys/kern/subr_kdb.c
> +++ b/sys/kern/subr_kdb.c
> @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
> #include <sys/pcpu.h>
> #include <sys/proc.h>
> #include <sys/smp.h>
> +#include <sys/stack.h>
> #include <sys/sysctl.h>
>
> #include <machine/kdb.h>
> @@ -300,6 +301,15 @@ kdb_backtrace(void)
> printf("KDB: stack backtrace:\n");
> kdb_dbbe->dbbe_trace();
> }
> +#ifdef STACK
> + else {
> + struct stack st;
> +
> + printf("KDB: stack backtrace:\n");
> + stack_save(&st);
> + stack_print(&st);
> + }
> +#endif
> }
>
> /*
>
It is still missing checking on opt_stack.h
Besides, I'd reconsider having KDB_TRACE explanation in ddb(4) manpage
(right now it is rightly there because it is DDB specific only, as
long as it offers the backend, but with your change it is a global
functionality. Not sure if it worths changing it but however you may
have more opinions).
Thanks,
Attilio
--
Peace can only be achieved by understanding - A. Einstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimuiBG4nL4o%2BJ%2BKM6%2B9QdkRwwEsWnbC-tsoNO54>
