[ovs-dev] [PATCH] backtrace: add LOG_BACKTRACE()

Andy Zhou azhou at nicira.com
Fri Mar 14 20:46:09 UTC 2014


Thanks for the input. I will send out a V2 implementing the suggested
changes.


On Fri, Mar 14, 2014 at 1:33 PM, Ben Pfaff <blp at nicira.com> wrote:

> On Thu, Mar 13, 2014 at 06:17:14PM -0700, Andy Zhou wrote:
> > LOG_BACKTRACE() logs the back trace into the log file. I find it
> > to be helpful when debugging unit tests. "backtrace.h" documents
> > the usage. It is not being called directly in the code, but rather as
> > a handy tool available when needed.
> >
> > Signed-off-by: Andy Zhou <azhou at nicira.com>
>
> This looks useful.
>
> I think that LOG_BACKTRACE and log_backtrace() could be defined more
> along the existing pattern with the *_at() functions like
> poll_fd_wait() and poll_fd_wait_at(), so that we'd have something more
> like this:
>
>     void log_backtrace_at(const char *where);
>     #define log_backtrace() log_backtrace_at(SOURCE_LOCATOR)
>
> I think that log_backtrace() could internally grab the backtrace.  I
> mean, it isn't strictly necessary to do it in the caller, you just get
> an extra entry at the top and that isn't normally a big deal.
>
> Do you think it's worthwhile to allow the backtrace user to specify a
> message to include?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140314/7c604e23/attachment-0005.html>


More information about the dev mailing list