Stay organized with collections Save and categorize content based on your preferences.

ActiveTrace

public class ActiveTrace
extends Object

java.lang.Object
   ↳ com.android.tradefed.invoker.tracing.ActiveTrace


Main class helping to describe and manage an active trace.

Summary

Fields

public static final String TRACE_KEY

Public constructors

ActiveTrace(long pid, long tid)

Constructor.

Public methods

void addSubprocessTrace(File subTrace)

Provide the trace file from a subprocess to be added to the parent.

File finalizeTracing()

Reports the final trace files and clean up resources as needed.

void reportTraceEvent(String categories, String name, PerfettoTrace.TrackEvent.Type type)
void reportTraceEvent(String categories, String name, int threadId, String threadName, PerfettoTrace.TrackEvent.Type type)

Very basic event reporting to do START / END of traces.

void startTracing(boolean isSubprocess)

Start the tracing and report the metadata of the trace.

Fields

TRACE_KEY

public static final String TRACE_KEY

Public constructors

ActiveTrace

public ActiveTrace (long pid, 
                long tid)

Constructor.

Parameters
pid long: Current process id

tid long: Current thread id

Public methods

addSubprocessTrace

public void addSubprocessTrace (File subTrace)

Provide the trace file from a subprocess to be added to the parent.

Parameters
subTrace File

finalizeTracing

public File finalizeTracing ()

Reports the final trace files and clean up resources as needed.

Returns
File

reportTraceEvent

public void reportTraceEvent (String categories, 
                String name, 
                PerfettoTrace.TrackEvent.Type type)

Parameters
categories String

name String

type PerfettoTrace.TrackEvent.Type

reportTraceEvent

public void reportTraceEvent (String categories, 
                String name, 
                int threadId, 
                String threadName, 
                PerfettoTrace.TrackEvent.Type type)

Very basic event reporting to do START / END of traces.

Parameters
categories String: Category associated with event

name String: Event name

threadId int

threadName String

type PerfettoTrace.TrackEvent.Type: Type of the event being reported

startTracing

public void startTracing (boolean isSubprocess)

Start the tracing and report the metadata of the trace.

Parameters
isSubprocess boolean