TraceCompat

public final class TraceCompat
extends Object

java.lang.Object
   ↳ androidx.core.os.TraceCompat


This class is deprecated.
TraceCompat is deprecated in favor of androidx.tracing.Trace. Please use that instead.

Writes trace events to the system trace buffer. These trace events can be collected and visualized using the Systrace tool.

This tracing mechanism is independent of the method tracing mechanism offered by Debug.startMethodTracing(). In particular, it enables tracing of events that occur across multiple processes.

For information about using the Systrace tool, read Overview of system tracing.

Summary

Public methods

static void beginAsyncSection(String methodName, int cookie)

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

static void beginSection(String sectionName)

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

static void endAsyncSection(String methodName, int cookie)

Writes a trace message to indicate that the current method has ended.

static void endSection()

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

static boolean isEnabled()

Checks whether or not tracing is currently enabled.

static void setCounter(String counterName, int counterValue)

Writes trace message to indicate the value of a given counter.

Inherited methods

Public methods

beginAsyncSection

public static void beginAsyncSection (String methodName, 
                int cookie)

Writes a trace message to indicate that a given section of code has begun. Must be followed by a call to endAsyncSection(String, int) with the same methodName and cookie. Unlike