[ovs-dev] [log backtrace v2] backtrace: add log_backtrace_*()

Andy Zhou azhou at nicira.com
Mon Mar 17 20:56:08 UTC 2014


Thanks for pointing them out.  How about the following incremental changes
to address both issues?

diff --git a/lib/backtrace.c b/lib/backtrace.c
index 3ff3fce..9b7c52b 100644
--- a/lib/backtrace.c
+++ b/lib/backtrace.c
@@ -15,9 +15,9 @@
  */

 #include <config.h>
+#include <inttypes.h>

 #include "backtrace.h"
-#include "inttypes.h"
 #include "vlog.h"

 VLOG_DEFINE_THIS_MODULE(backtrace);
diff --git a/lib/backtrace.h b/lib/backtrace.h
index 6211c53..2527243 100644
--- a/lib/backtrace.h
+++ b/lib/backtrace.h
@@ -20,7 +20,7 @@
 #include <stdint.h>
 #include "dynamic-string.h"

-/* LOG_BACKTRACE() will save the backtrace of a running program
+/* log_backtrace() will save the backtrace of a running program
  * into the log at the DEBUG level.



On Mon, Mar 17, 2014 at 1:49 PM, Ben Pfaff <blp at nicira.com> wrote:

> On Fri, Mar 14, 2014 at 02:24:33PM -0700, Andy Zhou wrote:
> > log_backtrace() and log_backtrace_msg() logs the back trace into
> > the log file. It may be most useful 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.
>
> In backtrace.h, the comment talks about LOG_BACKTRACE in all caps, but
> the actual macro is log_backtrace() in lowercase.  Either name is
> fine, as long as we're consistent.
>
> >  #include "backtrace.h"
> > +#include "inttypes.h"
>
> <inttypes.h> is the standard header.
>
> Acked-by: Ben Pfaff <blp at nicira.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140317/06974637/attachment-0005.html>


More information about the dev mailing list