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)
ActiveTrace(long pid, long tid, boolean mainProcess)

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.

boolean isMainTradefedProcess()
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.

long reportingThreadId()

thread id of the thread that initiated the tracing.

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)

Parameters
pid long

tid long

ActiveTrace

public ActiveTrace (long pid, 
                long tid, 
                boolean mainProcess)

Constructor.

Parameters
pid long: Current process id

tid long: Current thread id

mainProcess boolean

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

isMainTradefedProcess

public boolean isMainTradefedProcess ()

Returns
boolean

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

reportingThreadId

public long reportingThreadId ()

thread id of the thread that initiated the tracing.

Returns
long

startTracing

public void startTracing (boolean isSubprocess)

Start the tracing and report the metadata of the trace.

Parameters
isSubprocess boolean