<html><head></head><body><div class="ydp8ddc792yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
        <div dir="ltr" data-setdir="false">Thanks Maria for the response.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I defined in Makefile and i was just using only ospf, so no other undefs were interfering and it worked, except for 1 or 2 compilation errors.</div><div dir="ltr" data-setdir="false">As you suggested, there is no<span><span style="color: rgb(38, 40, 42); font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"> #undef to change to  #define in ospf specific files and its in common shared files.</span></span></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">So this <span>LOCAL_DEBUG/GLOBAL_DEBUG and DBG() support does not have a clean user interface requires changing the makefile/code.</span></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false">In ospf this DBG() is used to trace important information like neighbor state machine, lsa flooding, req/update...</div><div dir="ltr" data-setdir="false">So can we add another proto debug flags (<span><span style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif;">struct proto p-></span><span style="color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif;">debug;/* Debugging flags */) </span></span>like D_DBG and move the exiting use of DBG() to this? </div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><br></div>
        
        </div><div id="ydp76f8eceayahoo_quoted_7147578756" class="ydp76f8eceayahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Sunday, July 18, 2021, 11:54:46 AM GMT+5:30, Maria Matejka <maria.matejka@nic.cz> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div dir="ltr">Hello!<br clear="none"><br clear="none">On 7/18/21 7:48 AM, Senthil Kumar Nagappan wrote:<br clear="none">> Hi,<br clear="none">> <br clear="none">> To enable debug outputs using DBG macro, it requires LOCAL_DEBUG or <br clear="none">> GLOBAL_DEBUG to be defined during compilation.<br clear="none"><br clear="none">Yes, you are right. And GLOBAL_DEBUG is generally not recommended to <br clear="none">enable as it spits out loads of text.<br clear="none"><br clear="none">> 1. Defined it in the Makefile as below. Is there an option without <br clear="none">> changing the auto generated Makefile?<br clear="none">> <br clear="none">> CFLAGS=$(CPPFLAGS) -g -O2 -pthread -fno-strict-aliasing <br clear="none">> -fno-strict-overflow -flto -Wall -Wextra -Wstrict-prototypes <br clear="none">> -Wno-parentheses -Wno-pointer-sign <br clear="none">> -Wno-missing-field-initializers*-DLOCAL_DEBUG<br clear="none"><br clear="none">This is not recommended and it is also negated by the #undef's everywhere.<br clear="none"><br clear="none">> 2. If we try to define  LOCAL_DEBUG in the code, there are undef <br clear="none">> directive in the different places of the code, so may not work consistently.<br clear="none"><br clear="none">The right place to enable this is to _change_ the #undef to #define.<div class="ydp76f8eceayqt0399201616" id="ydp76f8eceayqtfd85337"><br clear="none"><br clear="none">> 3.  If we define this  LOCAL_DEBUG or GLOBAL_DEBUG, there are <br clear="none">> compilation errors that needs to be addressed.</div><br clear="none"><br clear="none">Yes, you are right. The DBG() calls are typically just left there from <br clear="none">the last debugging, not touched anymore, to see where it may make sense <br clear="none">to write out some debug message. These calls may be also totally unsafe. <br clear="none">Therefore you are supposed to check them thoroughly when enabling <br clear="none">LOCAL_DEBUG. You may induce other bugs simply by enabling LOCAL_DEBUG.<br clear="none"><br clear="none">Maria<div class="ydp76f8eceayqt0399201616" id="ydp76f8eceayqtfd04979"><br clear="none"><br clear="none"></div></div></div>
            </div>
        </div></body></html>