aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-12-30 19:06:33 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-10 06:36:21 -0500
commit0377b5acba2f258640822efe56fb29bada68bbe2 (patch)
tree082b2974757dfcfb422ca05da4a588846b5e3323 /include/acpi
parent10e9e75926ebec672d8a5031efbb21c938ca1820 (diff)
ACPICA: Merge all debug output macros into a single file, acoutput.
Moved the debug trace macros from acmacros.h into acoutput.h where they belong. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acoutput.h115
1 files changed, 115 insertions, 0 deletions
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 5ef4e57adc9e..c13b351a254d 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -300,7 +300,97 @@
300#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \ 300#define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \
301 ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename, component, __VA_ARGS__) 301 ACPI_DEBUG (acpi_debug_print_raw, level, line, filename, modulename, component, __VA_ARGS__)
302 302
303/*
304 * Function entry tracing
305 *
306 * The name of the function is emitted as a local variable that is
307 * intended to be used by both the entry trace and the exit trace.
308 */
309
310/* Helper macro */
311
312#define ACPI_TRACE_ENTRY(name, function, cast, param) \
313 ACPI_FUNCTION_NAME (name) \
314 function (ACPI_DEBUG_PARAMETERS, cast (param))
315
316/* The actual entry trace macros */
317
318#define ACPI_FUNCTION_TRACE(name) \
319 ACPI_FUNCTION_NAME(name) \
320 acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
321
322#define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
323 ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer)
324
325#define ACPI_FUNCTION_TRACE_U32(name, value) \
326 ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value)
327
328#define ACPI_FUNCTION_TRACE_STR(name, string) \
329 ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string)
330
331#define ACPI_FUNCTION_ENTRY() \
332 acpi_ut_track_stack_ptr()
333
334/*
335 * Function exit tracing
336 *
337 * These macros include a return statement. This is usually considered
338 * bad form, but having a separate exit macro before the actual return
339 * is very ugly and difficult to maintain.
340 *
341 * One of the FUNCTION_TRACE macros above must be used in conjunction
342 * with these macros so that "_AcpiFunctionName" is defined.
343 *
344 * Note: the DO_WHILE0 macro is used to prevent some compilers from
345 * complaining about these constructs. On other compilers the do...while
346 * adds some extra code, so this feature is optional.
347 */
348#ifdef ACPI_USE_DO_WHILE_0
349#define ACPI_DO_WHILE0(a) do a while(0)
303#else 350#else
351#define ACPI_DO_WHILE0(a) a
352#endif
353
354/* Exit trace helper macro */
355
356#define ACPI_TRACE_EXIT(function, cast, param) \
357 ACPI_DO_WHILE0 ({ \
358 function (ACPI_DEBUG_PARAMETERS, cast (param)); \
359 return ((param)); \
360 })
361
362/* The actual exit macros */
363
364#define return_VOID \
365 ACPI_DO_WHILE0 ({ \
366 acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
367 return; \
368 })
369
370#define return_ACPI_STATUS(status) \
371 ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status)
372
373#define return_PTR(pointer) \
374 ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer)
375
376#define return_VALUE(value) \
377 ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value)
378
379/* Conditional execution */
380
381#define ACPI_DEBUG_EXEC(a) a
382#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
383#define _VERBOSE_STRUCTURES
384
385/* Various object display routines for debug */
386
387#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0)
388#define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c)
389#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b)
390#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d)
391#define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
392
393#else /* ACPI_DEBUG_OUTPUT */
304/* 394/*
305 * This is the non-debug case -- make everything go away, 395 * This is the non-debug case -- make everything go away,
306 * leaving no executable debug code! 396 * leaving no executable debug code!
@@ -308,6 +398,31 @@
308#define ACPI_FUNCTION_NAME(a) 398#define ACPI_FUNCTION_NAME(a)
309#define ACPI_DEBUG_PRINT(pl) 399#define ACPI_DEBUG_PRINT(pl)
310#define ACPI_DEBUG_PRINT_RAW(pl) 400#define ACPI_DEBUG_PRINT_RAW(pl)
401#define ACPI_DEBUG_EXEC(a)
402#define ACPI_DEBUG_ONLY_MEMBERS(a)
403#define ACPI_FUNCTION_TRACE(a)
404#define ACPI_FUNCTION_TRACE_PTR(a, b)
405#define ACPI_FUNCTION_TRACE_U32(a, b)
406#define ACPI_FUNCTION_TRACE_STR(a, b)
407#define ACPI_FUNCTION_EXIT
408#define ACPI_FUNCTION_STATUS_EXIT(s)
409#define ACPI_FUNCTION_VALUE_EXIT(s)
410#define ACPI_FUNCTION_ENTRY()
411#define ACPI_DUMP_STACK_ENTRY(a)
412#define ACPI_DUMP_OPERANDS(a, b, c)
413#define ACPI_DUMP_ENTRY(a, b)
414#define ACPI_DUMP_TABLES(a, b)
415#define ACPI_DUMP_PATHNAME(a, b, c, d)
416#define ACPI_DUMP_BUFFER(a, b)
417#define ACPI_DEBUG_PRINT(pl)
418#define ACPI_DEBUG_PRINT_RAW(pl)
419
420/* Return macros must have a return statement at the minimum */
421
422#define return_VOID return
423#define return_ACPI_STATUS(s) return(s)
424#define return_VALUE(s) return(s)
425#define return_PTR(s) return(s)
311 426
312#endif /* ACPI_DEBUG_OUTPUT */ 427#endif /* ACPI_DEBUG_OUTPUT */
313 428