Merge all debug output macros into a single file, acoutput.h

Moved the debug trace macros from acmacros.h into acoutput.h
where they belong.
This commit is contained in:
Robert Moore 2012-11-30 14:44:14 -08:00
parent 0796525038
commit 79906133e5
2 changed files with 119 additions and 130 deletions

View File

@ -463,136 +463,6 @@
#endif /* ACPI_NO_ERROR_MESSAGES */
/*
* Debug macros that are conditionally compiled
*/
#ifdef ACPI_DEBUG_OUTPUT
/*
* Function entry tracing
*
* The name of the function is emitted as a local variable that is
* intended to be used by both the entry trace and the exit trace.
*/
/* Helper macro */
#define ACPI_TRACE_ENTRY(Name, Function, Cast, Param) \
ACPI_FUNCTION_NAME (Name) \
Function (ACPI_DEBUG_PARAMETERS, Cast (Param))
/* The actual entry trace macros */
#define ACPI_FUNCTION_TRACE(Name) \
ACPI_FUNCTION_NAME(Name) \
AcpiUtTrace (ACPI_DEBUG_PARAMETERS)
#define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \
ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, (void *), Pointer)
#define ACPI_FUNCTION_TRACE_U32(Name, Value) \
ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, (UINT32), Value)
#define ACPI_FUNCTION_TRACE_STR(Name, String) \
ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, (char *), String)
#define ACPI_FUNCTION_ENTRY() \
AcpiUtTrackStackPtr()
/*
* Function exit tracing
*
* These macros include a return statement. This is usually considered
* bad form, but having a separate exit macro before the actual return
* is very ugly and difficult to maintain.
*
* One of the FUNCTION_TRACE macros above must be used in conjunction
* with these macros so that "_AcpiFunctionName" is defined.
*
* Note: the DO_WHILE0 macro is used to prevent some compilers from
* complaining about these constructs. On other compilers the do...while
* adds some extra code, so this feature is optional.
*/
#ifdef ACPI_USE_DO_WHILE_0
#define ACPI_DO_WHILE0(a) do a while(0)
#else
#define ACPI_DO_WHILE0(a) a
#endif
/* Exit trace helper macro */
#define ACPI_TRACE_EXIT(Function, Cast, Param) \
ACPI_DO_WHILE0 ({ \
Function (ACPI_DEBUG_PARAMETERS, Cast (Param)); \
return ((Param)); \
})
/* The actual exit macros */
#define return_VOID \
ACPI_DO_WHILE0 ({ \
AcpiUtExit (ACPI_DEBUG_PARAMETERS); \
return; \
})
#define return_ACPI_STATUS(Status) \
ACPI_TRACE_EXIT (AcpiUtStatusExit, (ACPI_STATUS), Status)
#define return_PTR(Pointer) \
ACPI_TRACE_EXIT (AcpiUtPtrExit, (UINT8 *), Pointer)
#define return_VALUE(Value) \
ACPI_TRACE_EXIT (AcpiUtValueExit, (UINT64), Value)
/* Conditional execution */
#define ACPI_DEBUG_EXEC(a) a
#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
#define _VERBOSE_STRUCTURES
/* Various object display routines for debug */
#define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a), 0)
#define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c)
#define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b)
#define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d)
#define ACPI_DUMP_BUFFER(a, b) AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
#else
/*
* This is the non-debug case -- make everything go away,
* leaving no executable debug code!
*/
#define ACPI_DEBUG_EXEC(a)
#define ACPI_DEBUG_ONLY_MEMBERS(a)
#define ACPI_FUNCTION_TRACE(a)
#define ACPI_FUNCTION_TRACE_PTR(a, b)
#define ACPI_FUNCTION_TRACE_U32(a, b)
#define ACPI_FUNCTION_TRACE_STR(a, b)
#define ACPI_FUNCTION_EXIT
#define ACPI_FUNCTION_STATUS_EXIT(s)
#define ACPI_FUNCTION_VALUE_EXIT(s)
#define ACPI_FUNCTION_ENTRY()
#define ACPI_DUMP_STACK_ENTRY(a)
#define ACPI_DUMP_OPERANDS(a, b, c)
#define ACPI_DUMP_ENTRY(a, b)
#define ACPI_DUMP_TABLES(a, b)
#define ACPI_DUMP_PATHNAME(a, b, c, d)
#define ACPI_DUMP_BUFFER(a, b)
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_DEBUG_PRINT_RAW(pl)
#define return_VOID return
#define return_ACPI_STATUS(s) return(s)
#define return_VALUE(s) return(s)
#define return_PTR(s) return(s)
#endif /* ACPI_DEBUG_OUTPUT */
#if (!ACPI_REDUCED_HARDWARE)
#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr
#else

View File

@ -377,7 +377,100 @@
ACPI_DEBUG (AcpiDebugPrintRaw, Level, Line, Filename, Modulename, Component, __VA_ARGS__)
/*
* Function entry tracing
*
* The name of the function is emitted as a local variable that is
* intended to be used by both the entry trace and the exit trace.
*/
/* Helper macro */
#define ACPI_TRACE_ENTRY(Name, Function, Cast, Param) \
ACPI_FUNCTION_NAME (Name) \
Function (ACPI_DEBUG_PARAMETERS, Cast (Param))
/* The actual entry trace macros */
#define ACPI_FUNCTION_TRACE(Name) \
ACPI_FUNCTION_NAME(Name) \
AcpiUtTrace (ACPI_DEBUG_PARAMETERS)
#define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \
ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, (void *), Pointer)
#define ACPI_FUNCTION_TRACE_U32(Name, Value) \
ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, (UINT32), Value)
#define ACPI_FUNCTION_TRACE_STR(Name, String) \
ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, (char *), String)
#define ACPI_FUNCTION_ENTRY() \
AcpiUtTrackStackPtr()
/*
* Function exit tracing
*
* These macros include a return statement. This is usually considered
* bad form, but having a separate exit macro before the actual return
* is very ugly and difficult to maintain.
*
* One of the FUNCTION_TRACE macros above must be used in conjunction
* with these macros so that "_AcpiFunctionName" is defined.
*
* Note: the DO_WHILE0 macro is used to prevent some compilers from
* complaining about these constructs. On other compilers the do...while
* adds some extra code, so this feature is optional.
*/
#ifdef ACPI_USE_DO_WHILE_0
#define ACPI_DO_WHILE0(a) do a while(0)
#else
#define ACPI_DO_WHILE0(a) a
#endif
/* Exit trace helper macro */
#define ACPI_TRACE_EXIT(Function, Cast, Param) \
ACPI_DO_WHILE0 ({ \
Function (ACPI_DEBUG_PARAMETERS, Cast (Param)); \
return ((Param)); \
})
/* The actual exit macros */
#define return_VOID \
ACPI_DO_WHILE0 ({ \
AcpiUtExit (ACPI_DEBUG_PARAMETERS); \
return; \
})
#define return_ACPI_STATUS(Status) \
ACPI_TRACE_EXIT (AcpiUtStatusExit, (ACPI_STATUS), Status)
#define return_PTR(Pointer) \
ACPI_TRACE_EXIT (AcpiUtPtrExit, (UINT8 *), Pointer)
#define return_VALUE(Value) \
ACPI_TRACE_EXIT (AcpiUtValueExit, (UINT64), Value)
/* Conditional execution */
#define ACPI_DEBUG_EXEC(a) a
#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
#define _VERBOSE_STRUCTURES
/* Various object display routines for debug */
#define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a), 0)
#define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c)
#define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b)
#define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d)
#define ACPI_DUMP_BUFFER(a, b) AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
#else /* ACPI_DEBUG_OUTPUT */
/*
* This is the non-debug case -- make everything go away,
* leaving no executable debug code!
@ -385,7 +478,33 @@
#define ACPI_FUNCTION_NAME(a)
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_DEBUG_PRINT_RAW(pl)
#define ACPI_DEBUG_EXEC(a)
#define ACPI_DEBUG_ONLY_MEMBERS(a)
#define ACPI_FUNCTION_TRACE(a)
#define ACPI_FUNCTION_TRACE_PTR(a, b)
#define ACPI_FUNCTION_TRACE_U32(a, b)
#define ACPI_FUNCTION_TRACE_STR(a, b)
#define ACPI_FUNCTION_EXIT
#define ACPI_FUNCTION_STATUS_EXIT(s)
#define ACPI_FUNCTION_VALUE_EXIT(s)
#define ACPI_FUNCTION_ENTRY()
#define ACPI_DUMP_STACK_ENTRY(a)
#define ACPI_DUMP_OPERANDS(a, b, c)
#define ACPI_DUMP_ENTRY(a, b)
#define ACPI_DUMP_TABLES(a, b)
#define ACPI_DUMP_PATHNAME(a, b, c, d)
#define ACPI_DUMP_BUFFER(a, b)
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_DEBUG_PRINT_RAW(pl)
/* Return macros must have a return statement at the minimum */
#define return_VOID return
#define return_ACPI_STATUS(s) return(s)
#define return_VALUE(s) return(s)
#define return_PTR(s) return(s)
#endif /* ACPI_DEBUG_OUTPUT */
#endif /* __ACOUTPUT_H__ */