Home | History | Annotate | Download | only in pdx
      1 #ifndef ANDROID_PDX_TRACE_H_
      2 #define ANDROID_PDX_TRACE_H_
      3 
      4 // Tracing utilities for libpdx. Tracing in the service framework is enabled
      5 // under these conditions:
      6 //    1. ATRACE_TAG is defined, AND
      7 //    2. ATRACE_TAG does not equal ATRACE_TAG_NEVER, AND
      8 //    3. PDX_TRACE_ENABLED is defined, AND
      9 //    4. PDX_TRACE_ENABLED is equal to logical true.
     10 //
     11 // If any of these conditions are not met tracing is completely removed from the
     12 // library and headers.
     13 
     14 // If ATRACE_TAG is not defined, default to never.
     15 #ifndef ATRACE_TAG
     16 #define ATRACE_TAG ATRACE_TAG_NEVER
     17 #endif
     18 
     19 // Include tracing functions after the trace tag is defined.
     20 #include <utils/Trace.h>
     21 
     22 // If PDX_TRACE_ENABLED is not defined, default to off.
     23 #ifndef PDX_TRACE_ENABLED
     24 #define PDX_TRACE_ENABLED 0
     25 #endif
     26 
     27 #if (ATRACE_TAG) != (ATRACE_TAG_NEVER) && (PDX_TRACE_ENABLED)
     28 #define PDX_TRACE_NAME ATRACE_NAME
     29 #else
     30 #define PDX_TRACE_NAME(name) \
     31   do {                       \
     32   } while (0)
     33 #endif
     34 
     35 #endif  // ANDROID_PDX_TRACE_H_
     36