Tracing

#include <trace.h>

Summary

Functions

ATrace_beginSection(const char *sectionName)
void
Writes a tracing message to indicate that the given section of code has begun.
ATrace_endSection()
void
Writes a tracing message to indicate that a given section of code has ended.
ATrace_isEnabled()
bool
Returns true if tracing is enabled.

Functions

ATrace_beginSection

void ATrace_beginSection(
  const char *sectionName
)

Writes a tracing message to indicate that the given section of code has begun.

This call must be followed by a corresponding call to ATrace_endSection on the same thread.

Note: At this time the vertical bar character '|' and newline character '\n' are used internally by the tracing mechanism. If sectionName contains these characters they will be replaced with a space character in the trace.

Available since API level 23.

ATrace_endSection

void ATrace_endSection()

Writes a tracing message to indicate that a given section of code has ended.

This call must be preceeded by a corresponding call to ATrace_beginSection on the same thread. Calling this method will mark the end of the most recently begun section of code, so care must be taken to ensure that ATrace_beginSection/ATrace_endSection pairs are properly nested and called from the same thread.

Available since API level 23.

ATrace_isEnabled

bool ATrace_isEnabled()

Returns true if tracing is enabled.

Use this to avoid expensive computation only necessary when tracing is enabled.

Available since API level 23.