<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14443">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Scope Tracing: Add stubs to allow easier cherry-picking<br><br>Scope tracing isn't supported in Asterisk 13 due to changes made<br>to logging between 13 and 16 but since the scope tracing macros<br>may be present in the 16, 17 and master branches, those macros<br>are defined here as NOOPs so cherry-picking changes downward<br>to 13 can still be seamless.<br><br>Change-Id: I0390ce5651374d8f3e06d7620050acb22c5440a2<br>---<br>M include/asterisk/logger.h<br>1 file changed, 65 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/14443/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h</span><br><span>index e19ba94..ada04ab 100644</span><br><span>--- a/include/asterisk/logger.h</span><br><span>+++ b/include/asterisk/logger.h</span><br><span>@@ -26,6 +26,7 @@</span><br><span> #define _ASTERISK_LOGGER_H</span><br><span> </span><br><span> #include "asterisk/options.h" /* need option_debug */</span><br><span style="color: hsl(120, 100%, 40%);">+#include "asterisk/inline_api.h"</span><br><span> </span><br><span> #if defined(__cplusplus) || defined(c_plusplus)</span><br><span> extern "C" {</span><br><span>@@ -231,6 +232,17 @@</span><br><span> #endif</span><br><span> #define AST_LOG_DEBUG __LOG_DEBUG, _A_</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef LOG_TRACE</span><br><span style="color: hsl(120, 100%, 40%);">+#undef LOG_TRACE</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+#define __LOG_TRACE 1</span><br><span style="color: hsl(120, 100%, 40%);">+#define LOG_TRACE __LOG_TRACE, _A_</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef AST_LOG_TRACE</span><br><span style="color: hsl(120, 100%, 40%);">+#undef AST_LOG_TRACE</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+#define AST_LOG_TRACE __LOG_TRACE, _A_</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #ifdef LOG_NOTICE</span><br><span> #undef LOG_NOTICE</span><br><span> #endif</span><br><span>@@ -543,6 +555,59 @@</span><br><span> */</span><br><span> int ast_logger_get_queue_limit(void);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*!</span><br><span style="color: hsl(120, 100%, 40%);">+ \page Scope_Trace Scope Trace</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Scope tracing is not available in this version of Asterisk.</span><br><span style="color: hsl(120, 100%, 40%);">+The declatrations and stubs below are there to facilitate</span><br><span style="color: hsl(120, 100%, 40%);">+cherry-picking from branches where it is available.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*!</span><br><span style="color: hsl(120, 100%, 40%);">+ * \brief Get the trace level for a module</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param module the name of module</span><br><span style="color: hsl(120, 100%, 40%);">+ * \return the trace level</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+AST_INLINE_API(</span><br><span style="color: hsl(120, 100%, 40%);">+unsigned int ast_trace_get_by_module(const char *module),</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#define TRACE_ATLEAST(level) (0)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*!</span><br><span style="color: hsl(120, 100%, 40%);">+ * \brief Controls if and when indenting is applied.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+enum ast_trace_indent_type {</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Use the existing indent level */</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_TRACE_INDENT_SAME = 0,</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Increment the indent before printing the message */</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_TRACE_INDENT_INC_BEFORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Increment the indent after printing the message */</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_TRACE_INDENT_INC_AFTER,</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Decrement the indent before printing the message */</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_TRACE_INDENT_DEC_BEFORE,</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Decrement the indent after printing the message */</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_TRACE_INDENT_DEC_AFTER,</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Don't use or alter the level */</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_TRACE_INDENT_NONE,</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * The "#if 1" keeps the last few lines of scope tracing</span><br><span style="color: hsl(120, 100%, 40%);">+ * common to all branches.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+#if 1</span><br><span style="color: hsl(120, 100%, 40%);">+#define ast_trace(__level)</span><br><span style="color: hsl(120, 100%, 40%);">+#define ast_trace_raw(__level, __indent_type, __fmt, ...)</span><br><span style="color: hsl(120, 100%, 40%);">+#define ast_trace_msg(__level, __indent_type, __fmt, ...)</span><br><span style="color: hsl(120, 100%, 40%);">+#define SCOPE_TRACE_MSG(__debug_level, __fmt, ...)</span><br><span style="color: hsl(120, 100%, 40%);">+#define SCOPE_TRACE(__level)</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #if defined(__cplusplus) || defined(c_plusplus)</span><br><span> }</span><br><span> #endif</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14443">change 14443</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14443"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I0390ce5651374d8f3e06d7620050acb22c5440a2 </div>
<div style="display:none"> Gerrit-Change-Number: 14443 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>