[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #55199] ppp: inefficient debug disable

From: Sergey A. Borshch
Subject: [lwip-devel] [bug #55199] ppp: inefficient debug disable
Date: Mon, 10 Dec 2018 18:23:01 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.113 Safari/537.36 Vivaldi/2.1.1337.51


                 Summary: ppp: inefficient debug disable
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: dushevny
            Submitted on: Mon 10 Dec 2018 11:22:59 PM UTC
                Category: PPP
                Severity: 3 - Normal
              Item Group: Change Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head



Even in PPP debug output disabled by not defining PPP_DEBUG macro,
ppp_dbglog(), ppp_info(), ppp_notice() etc. functions calls ppp_logit()
function, which allocates 1024 bytes on stack, wastes CPU time in
ppp_vslprintf() and calls ppp_log_write(), where debug output is actually
disabled by PPPDEBUG() defined to empty code. Additionally all ppp debug
strings are also linked into resulting executable. Replacing debug functions
declaration in ppp_impl.h with 
void ppp_dbglog(const char *fmt, ...);    /* log a debug message */
void ppp_info(const char *fmt, ...);      /* log an informational message */
void ppp_notice(const char *fmt, ...);    /* log a notice-level message */
void ppp_warn(const char *fmt, ...);      /* log a warning message */
void ppp_error(const char *fmt, ...);     /* log an error message */
void ppp_fatal(const char *fmt, ...);     /* log an error message and die(1)
#define ppp_dbglog(...)     do {} while(0)  /* log a debug message */
#define ppp_info(...)       do {} while(0)  /* log an informational message
#define ppp_notice(...)     do {} while(0)  /* log a notice-level message */
#define ppp_warn(...)       do {} while(0)  /* log a warning message */
#define ppp_error(...)      do {} while(0)  /* log an error message */
#define ppp_fatal(...)      do {} while(0)  /* log an error message and die(1)
and small sources tuning to suppress warnings about unused variables reduces
executable size for more than 5 Kbytes on Cortex-M3 target, saves more than 1
K RAM on lwip main process stack and makes code faster by not executing
needless code.


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]