Update ACPICA to 20150818.
[haiku.git] / src / add-ons / kernel / bus_managers / ata / ATATracing.h
blobe779f5bfeae461b8a841dc21940718f05b8c20f4
1 /*
2 * Copyright 2009, Michael Lotz, mmlr@mlotz.ch.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef ATA_TRACING_H
6 #define ATA_TRACING_H
8 #include <tracing.h>
10 #define ATA_TRACE_START 0x00
11 #define ATA_TRACE_FLUSH 0x01
12 #define ATA_TRACE_SYSLOG 0x02
13 #define ATA_TRACE_FLUSH_SYSLOG 0x03
15 #if ATA_TRACING
16 #define TRACE(x...) { \
17 ata_trace_printf(ATA_TRACE_START, \
18 "ata%s: ", _DebugContext()); \
19 ata_trace_printf(ATA_TRACE_FLUSH, x); \
21 #define TRACE_FUNCTION(x...) { \
22 ata_trace_printf(ATA_TRACE_START, \
23 "ata%s: %s: ", _DebugContext(), \
24 __FUNCTION__); \
25 ata_trace_printf(ATA_TRACE_FLUSH, x); \
27 #else
28 #define TRACE(x...) /* nothing */
29 #define TRACE_FUNCTION(x...) /* nothing */
30 #endif
32 #define TRACE_ALWAYS(x...) { \
33 ata_trace_printf(ATA_TRACE_START, \
34 "ata%s: ", _DebugContext()); \
35 ata_trace_printf(ATA_TRACE_FLUSH_SYSLOG, x); \
37 #define TRACE_ERROR(x...) { \
38 ata_trace_printf(ATA_TRACE_START, \
39 "ata%s error: ", _DebugContext()); \
40 ata_trace_printf(ATA_TRACE_FLUSH_SYSLOG, x); \
43 void ata_trace_printf(uint32 flags, const char *format, ...);
45 inline const char *
46 _DebugContext()
48 return "";
51 #endif // ATA_TRACING_H