TR181-XPON  1.4.0
TR-181 PON manager.
xpon_trace.h File Reference
#include <debug/sahtrace.h>
#include <debug/sahtrace_macros.h>

Go to the source code of this file.

Macros

#define ME   "xpon"
 
#define SAHTRACE_DEBUG   "", "d", "", ""
 
#define TRACE_LEVEL_DEBUG1   TRACE_LEVEL_CALLSTACK
 
#define SAH_TRACE_DEBUG(format, ...)   sahTrace(TRACE_LEVEL_DEBUG1, "%s%-7.7s%s - %s[%s]%s%s" format "%s - %s(%s@%s:%d)%s", SAHTRACE_ZONE(""), SAHTRACE_DEBUG, ## __VA_ARGS__, SAHTRACE_SOURCE)
 
#define SAH_TRACEZ_DEBUG(zone, format, ...)   sahTraceZ(TRACE_LEVEL_DEBUG1, zone, "%s%-7.7s%s - %s[%s]%s%s" format "%s - %s(%s@%s:%d)%s", SAHTRACE_ZONE(zone), SAHTRACE_DEBUG, ## __VA_ARGS__, SAHTRACE_SOURCE)
 
#define SAH_TRACE_DEBUG2(format, ...)   SAH_TRACE_DO_NOTHING
 
#define SAH_TRACEZ_DEBUG2(zone, format, ...)   SAH_TRACE_DO_NOTHING
 

Detailed Description

Tracing macros.

Definition in file xpon_trace.h.

Macro Definition Documentation

◆ ME

#define ME   "xpon"

Trace zone name

Unique string to easily grep on in log file, e.g.: grep xpon /ext/messages

Definition at line 78 of file xpon_trace.h.

◆ SAH_TRACE_DEBUG

#define SAH_TRACE_DEBUG (   format,
  ... 
)    sahTrace(TRACE_LEVEL_DEBUG1, "%s%-7.7s%s - %s[%s]%s%s" format "%s - %s(%s@%s:%d)%s", SAHTRACE_ZONE(""), SAHTRACE_DEBUG, ## __VA_ARGS__, SAHTRACE_SOURCE)

Definition at line 114 of file xpon_trace.h.

◆ SAH_TRACE_DEBUG2

#define SAH_TRACE_DEBUG2 (   format,
  ... 
)    SAH_TRACE_DO_NOTHING

Definition at line 126 of file xpon_trace.h.

◆ SAH_TRACEZ_DEBUG

#define SAH_TRACEZ_DEBUG (   zone,
  format,
  ... 
)    sahTraceZ(TRACE_LEVEL_DEBUG1, zone, "%s%-7.7s%s - %s[%s]%s%s" format "%s - %s(%s@%s:%d)%s", SAHTRACE_ZONE(zone), SAHTRACE_DEBUG, ## __VA_ARGS__, SAHTRACE_SOURCE)

Definition at line 115 of file xpon_trace.h.

◆ SAH_TRACEZ_DEBUG2

#define SAH_TRACEZ_DEBUG2 (   zone,
  format,
  ... 
)    SAH_TRACE_DO_NOTHING

Definition at line 127 of file xpon_trace.h.

◆ SAHTRACE_DEBUG

#define SAHTRACE_DEBUG   "", "d", "", ""

Definition at line 86 of file xpon_trace.h.

◆ TRACE_LEVEL_DEBUG1

#define TRACE_LEVEL_DEBUG1   TRACE_LEVEL_CALLSTACK

Tell GCC to consider the rest of this header as a system header.

Reason: Without the pragma statement, the following compile error occurs for a statement like: SAH_TRACEZ_DEBUG(ME, "called"):

error: ISO C99 requires at least one argument for the "..." in a variadic macro [-Werror]
156 | SAH_TRACEZ_DEBUG(ME, "called");
#define SAH_TRACEZ_DEBUG(zone, format,...)
Definition: xpon_trace.h:115
#define ME
Definition: xpon_trace.h:78

The error does not occur for 'SAH_TRACEZ_INFO(ME, "called");'. Reason: GCC treats sahtrace.h as a system header. GCC checks system headers less strictly for conformance. Use next pragma to tell GCC to treat this header in the same way as sahtrace.h and other system headers.

See: https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html

Definition at line 113 of file xpon_trace.h.