41 #ifndef _CL_DEBUG_API_H_
42 #define _CL_DEBUG_API_H_
63 int backtrace(
void **buffer,
int count);
64 char **backtrace_symbols(
void *
const *array,
int size);
65 void backtrace_symbols_fd(
void *
const *array,
int size,
int fd);
80 #define CL_DEBUG_CRITICAL 3
85 #define CL_DEBUG_ERROR 4
90 #define CL_DEBUG_WARN 5
95 #define CL_DEBUG_INFO 7
100 #define CL_DEBUG_TRACE 0xc
107 #if !defined(CL_DEBUG_LEVEL_THRESHOLD)
108 #define CL_DEBUG_LEVEL_THRESHOLD CL_DEBUG_ERROR
126 #define CL_DEBUG_SP(...) __VA_ARGS__
128 #define clCompStatLog(...) clLog(CL_LOG_SEV_DEBUG,"COMP","STAT", __VA_ARGS__)
134 clDebugTimeStrMaxLen = 128
137 #define CL_DEBUG_PRINT(x,y) \
141 if(x <= CL_DEBUG_LEVEL_THRESHOLD) \
143 snprintf(__str,256,CL_DEBUG_SP y); \
144 clLog((ClLogSeverityT)x, CL_LOG_AREA_UNSPECIFIED, CL_LOG_CONTEXT_UNSPECIFIED,\
149 snprintf(__str,256,CL_DEBUG_SP y); \
150 clDbgMsg((int)getpid(),__FILE__, __LINE__, __FUNCTION__,x,__str); \
154 #define CL_DEBUG_PRINT_CONSOLE(x,y) \
158 if(x <= CL_DEBUG_LEVEL_THRESHOLD) \
160 snprintf(__str,256,CL_DEBUG_SP y); \
161 clLogConsole((ClLogSeverityT)x, CL_LOG_AREA_UNSPECIFIED, CL_LOG_CONTEXT_UNSPECIFIED, \
166 snprintf(__str,256,CL_DEBUG_SP y); \
167 clDbgMsg((int)getpid(),__FILE__, __LINE__, __FUNCTION__,x,__str); \
173 #define CL_DEBUG_PRINT(x,y) \
176 if(x <= CL_DEBUG_LEVEL_THRESHOLD) \
178 printk("file:%s,func:%s,line:%d: ", __FILE__, __FUNCTION__, __LINE__);\
183 #define CL_DEBUG_PRINT_CONSOLE CL_DEBUG_PRINT
188 #define CL_DEBUG_PRINT(x,y)
189 #define CL_DEBUG_PRINT_CONSOLE(x, y)
195 #define CL_FUNC_ENTER()
201 #define CL_FUNC_EXIT()
209 #define CL_ASSERT(expr) \
212 ClBoolT val = (expr)?CL_TRUE:CL_FALSE; \
213 if (clDbgPauseOnCodeError && !val ) \
214 clDbgCodeError(0,("Assertion failed")); \
220 struct clEoExecutionObj;
225 #define CL_DEBUG_COMP_PROMPT_LEN 15
231 #define CL_DEBUG_COMP_NAME_LEN 128
237 #define CL_DEBUG_FUNC_NAME_LEN 41
242 #define CL_DEBUG_FUNC_HELP_LEN 201
340 CL_IN ClCharT *nprompt );
446 CL_IN ClUint32T funcArrayLen,
447 CL_OUT ClHandleT *phDebugReg);
450 CL_IN ClUint32T funcArrayLen,
451 CL_OUT ClHandleT *phDebugReg);
533 CL_IN const char* fmtStr,
534 ...) CL_PRINTF_FORMAT(2, 3);
614 ClRcT clDebugResponseSend(ClRmdResponseContextHandleT responseHandle,
618 ClRcT clDebugResponseDefer(ClRmdResponseContextHandleT *pResponseHandle,
ClBufferHandleT *pOutMsgHandle);
621 clDebugPrintExtended(ClCharT **retstr, ClInt32T *maxBytes, ClInt32T *curBytes,
622 const ClCharT *format, ...) CL_PRINTF_FORMAT(4, 5);
Typical defines found in any software project.
Header file of Debug Error Codes.
Header file of EO related APIs.
Header file of Log Service related APIs.
Header file of Handle Management related APIs.
ClPtrT ClBufferHandleT
The type of the handle for the buffer messages.
Definition: clBufferApi.h:82
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_INOUT
CL_INOUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:108
#define CL_OUT
CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:110
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106
struct ClDebugModEntryT ClDebugModEntryT
This structure is used to register the module with the CLI library.
#define CL_DEBUG_FUNC_HELP_LEN
The maximum length of the help for a command of the component in the debug CLI.
Definition: clDebugApi.h:242
ClRcT clDebugRegister(CL_IN ClDebugFuncEntryT *funcArray, CL_IN ClUint32T funcArrayLen, CL_OUT ClHandleT *phDebugReg)
Registers the component name.
ClRcT clDebugPrint(CL_INOUT ClDebugPrintHandleT msg, CL_IN const char *fmtStr,...) CL_PRINTF_FORMAT(2
Prints a string into the handle.
ClRcT clDebugLibFinalize(void)
Finalizes the Debug CLI library.
ClRcT clDebugCli(CL_IN ClCharT *nprompt)
Invokes the library based local debug CLI.
ClRcT clDebugDeregister(CL_IN ClHandleT hReg)
De-registers the debug CLI information from the EO.
ClRcT clDebugPrintInitialize(CL_OUT ClDebugPrintHandleT *msg)
Retrieve a handle for printing.
ClRcT clDebugPrintDestroy(CL_INOUT ClDebugPrintHandleT *msg)
Frees the print handle.
ClRcT clDebugPromptSet(CL_IN const ClCharT *pCompPrompt)
Sets the name and prompt of the component.
#define CL_DEBUG_FUNC_NAME_LEN
The maximum length of a command of the component in the debug CLI.
Definition: clDebugApi.h:237
ClRcT(* ClDebugCallbackT)(ClUint32T argc, ClCharT **argv, ClCharT **ret)
This is the signature of the callback invoked by the debug CLI in response to a command entered.
Definition: clDebugApi.h:249
ClRcT ClRcT clDebugPrintFinalize(CL_IN ClDebugPrintHandleT *msg, CL_OUT char **buf)
Cleans up the print handle.
struct ClDebugFuncEntryT ClDebugFuncEntryT
The structure contains the entry for the debug CLI information that needs the component has to provid...
ClRcT clDebugVersionCheck(CL_INOUT ClVersionT *pVersion)
Check the given version is supported or not.
ClPtrT ClDebugPrintHandleT
The type of the handle clDebugPrint APIs.
Definition: clDebugApi.h:312
ClRcT clDebugLibInitialize(void)
Initializes the Debug CLI library.
Version Information for various services.
Definition: clCommon.h:250
The structure contains the entry for the debug CLI information that needs the component has to provid...
Definition: clDebugApi.h:270
ClCharT funcName[CL_DEBUG_FUNC_NAME_LEN]
Name of the command used while invoking the command.
Definition: clDebugApi.h:279
ClDebugCallbackT fpCallback
Function to be invoked upon a command entered on the CLI.
Definition: clDebugApi.h:274
ClCharT funcHelp[CL_DEBUG_FUNC_HELP_LEN]
One line help for the command.
Definition: clDebugApi.h:284
This structure is used to register the module with the CLI library.
Definition: clDebugApi.h:290
char modName[80]
Module name.
Definition: clDebugApi.h:295
char modPrompt[20]
Module prompt.
Definition: clDebugApi.h:300
ClDebugFuncEntryT * cmdList
List of commands and their functions.
Definition: clDebugApi.h:305