Navigation


Changeset 594:0758a357a151 in freeDiameter


Ignore:
Timestamp:
Nov 2, 2010, 9:59:36 AM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Added a new MaxPerformance? build type for tests, not recommended for use

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r581 r594  
    4141SET(CMAKE_C_FLAGS_PROFILING "-fprofile-arcs -ftest-coverage -fstack-protector -g -Wall")
    4242
     43# Add a "MaxPerformance" build type -- this is very silent...
     44# SET(CMAKE_BUILD_TYPE MaxPerformance)
     45SET(CMAKE_C_FLAGS_MAXPERFORMANCE "${CMAKE_C_FLAGS_RELEASE} -DSTRIP_DEBUG_CODE")
     46
    4347# Add a "DebianPackage" build type used when creating the Debian packages
    4448SET(CMAKE_C_FLAGS_DEBIANPACKAGE "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
  • include/freeDiameter/libfreeDiameter.h

    r542 r594  
    355355}
    356356
     357/* Report an error */
     358#define TRACE_DEBUG_ERROR(format,args... ) \
     359        TRACE_DEBUG(NONE, format, ##args)
     360
     361/******************
     362 Optimized code: remove all debugging code
     363 **/
     364#ifdef STRIP_DEBUG_CODE
     365#undef TRACE_DEBUG
     366#undef TRACE_BOOL
     367#undef TRACE_DEBUG_sSA
     368#undef TRACE_DEBUG_BUFFER
     369#undef TRACE_DEBUG_ERROR
     370#define TRACE_DEBUG(level,format,args... )
     371#define TRACE_BOOL(_level_) (0)
     372#define TRACE_DEBUG_BUFFER(level, prefix, buf, bufsz, suffix )
     373#define TRACE_DEBUG_sSA(level, prefix, sa, flags, suffix )
     374#define TRACE_DEBUG_ERROR(format,args... ) {    \
     375        fd_log_debug(format "\n", ## args);     \
     376}
     377#endif /* STRIP_DEBUG_CODE */
     378
    357379
    358380/*============================================================*/
     
    371393        if (__ret__ < 0) {                                                              \
    372394                int __err__ = errno;    /* We may handle EINTR here */                  \
    373                 TRACE_DEBUG(NONE, "ERROR: in '" #__call__ "' :\t%s", strerror(__err__));\
     395                TRACE_DEBUG_ERROR("ERROR: in '" #__call__ "' :\t%s", strerror(__err__));\
    374396                __fallback__;                                                           \
    375397        }                                                                               \
     
    382404        if (__ret__ < 0) {                                                              \
    383405                int __err__ = errno;    /* We may handle EINTR here */                  \
    384                 TRACE_DEBUG(NONE, "ERROR: in '" #__call__ "' :\t%s", strerror(__err__));\
     406                TRACE_DEBUG_ERROR("ERROR: in '" #__call__ "' :\t%s", strerror(__err__));\
    385407                return __err__;                                                         \
    386408        }                                                                               \
     
    396418                        __fallback1__;                                                          \
    397419                } else {                                                                        \
    398                         TRACE_DEBUG(NONE, "ERROR: in '" #__call__ "':\t%s", strerror(__ret__)); \
     420                        TRACE_DEBUG_ERROR("ERROR: in '" #__call__ "':\t%s", strerror(__ret__)); \
    399421                        __fallback2__;                                                          \
    400422                }                                                                               \
     
    419441        if (__ret__ == NULL) {                                                          \
    420442                int __err__ = errno;                                                    \
    421                 TRACE_DEBUG(NONE, "ERROR: in '" #__call__ "':\t%s", strerror(__err__)); \
     443                TRACE_DEBUG_ERROR("ERROR: in '" #__call__ "':\t%s", strerror(__err__)); \
    422444                __fallback__;                                                           \
    423445        }                                                                               \
     
    430452
    431453/* Check parameters at function entry, execute fallback on error */
    432 #define CHECK_PARAMS_DO( __bool__, __fallback__ )                                       \
    433         TRACE_DEBUG_ALL( "Check PARAMS: " #__bool__ );                                  \
    434         if ( ! (__bool__) ) {                                                           \
    435                 TRACE_DEBUG(INFO, "Invalid parameter received in '" #__bool__ "'");     \
    436                 __fallback__;                                                           \
     454#define CHECK_PARAMS_DO( __bool__, __fallback__ )                                               \
     455        TRACE_DEBUG_ALL( "Check PARAMS: " #__bool__ );                                          \
     456        if ( ! (__bool__) ) {                                                                   \
     457                TRACE_DEBUG_ERROR("Warning: Invalid parameter received in '" #__bool__ "'");    \
     458                __fallback__;                                                                   \
    437459        }
    438460/* Check parameters at function entry, return EINVAL if the boolean is false (similar to assert) */
     
    446468        __ret__ = (__call__);                                                           \
    447469        if (__ret__ != 0) {                                                             \
    448                 TRACE_DEBUG(INFO, "Error in '" #__call__ "':\t%s", strerror(__ret__));  \
     470                TRACE_DEBUG_ERROR("ERROR: in '" #__call__ "':\t%s", strerror(__ret__)); \
    449471                __fallback__;                                                           \
    450472        }                                                                               \
Note: See TracChangeset for help on using the changeset viewer.