openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

debug.h (1487B)


      1 /*
      2  * 
      3  * 
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      7  */
      8 
      9 #ifndef __BCM_DEBUG_H__
     10 #define __BCM_DEBUG_H__
     11 
     12 #include <shared/bsl.h>
     13 
     14 #include <bcm/types.h>
     15 
     16 #ifndef BCM_HIDE_DISPATCHABLE
     17 
     18 /* _bcm_debug_api */
     19 extern void _bcm_debug_api(
     20     int log_src,
     21     char *api, 
     22     int nargs, 
     23     int ninargs, 
     24     int arg1, 
     25     int arg2, 
     26     int arg3, 
     27     int rv);
     28 
     29 #endif /* BCM_HIDE_DISP  ATCHABLE */
     30 
     31 #define BCM_CALL_DISPATCH(ret, f_api, args, n_args, args_by_ref) ret = f_api args
     32 
     33 #define BCM_API_SET_CONTEXT(file, line, Func)
     34 
     35 #if defined(BROADCOM_DEBUG)
     36 #define BCM_API(_1, _2, _3, _4, _5, _6, _7, _8)  \
     37     do { \
     38         if (LOG_CHECK(_1 | BSL_VERBOSE)) \
     39            _bcm_debug_api(_1,_2,_3,_4,_5,_6,_7,_8); \
     40     } while (0) 
     41 
     42 /*
     43  * BCM_API_VERBOSE_LOGGING enables capability to log API calls along with their
     44  * arguments using CINT infrastructure.
     45  */
     46 #ifdef BCM_API_VERBOSE_LOGGING
     47 
     48 #include "src/appl/cint/cint_logger.h"
     49 
     50 #undef BCM_CALL_DISPATCH
     51 #define BCM_CALL_DISPATCH(ret, f_api, args, n_args, args_by_ref) \
     52         CINT_LOGGER_CALL_DISPATCH(ret, f_api, args, n_args, args_by_ref)
     53 
     54 #undef BCM_API_SET_CONTEXT
     55 #define BCM_API_SET_CONTEXT(file, line, Func) \
     56         CINT_LOGGER_SET_CALLER_CONTEXT(file, line, Func)
     57 
     58 #endif
     59 
     60 #else
     61 #define BCM_API(_1, _2, _3, _4, _5, _6, _7, _8)
     62 #endif
     63 
     64 #endif /* __BCM_DEBUG_H__ */