主动跟踪

public class ActiveTrace
extends Object

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


主类帮助描述和管理活动跟踪。

概括

领域

public static final String TRACE_KEY

公共构造函数

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

构造函数。

公共方法

void addSubprocessTrace (File subTrace)

提供要添加到父进程的子进程的跟踪文件。

File finalizeTracing ()

报告最终跟踪文件并根据需要清理资源。

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)

用于执行跟踪的开始/结束的非常基本的事件报告。

long reportingThreadId ()

启动跟踪的线程的线程 ID。

void startTracing (boolean isSubprocess)

启动跟踪并报告跟踪的元数据。

领域

TRACE_KEY

public static final String TRACE_KEY

公共构造函数

主动跟踪

public ActiveTrace (long pid, 
                long tid)

参数
pid long

tid long

主动跟踪

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

构造函数。

参数
pid long :当前进程ID

tid long :当前线程ID

mainProcess boolean

公共方法

添加子进程跟踪

public void addSubprocessTrace (File subTrace)

提供要添加到父进程的子进程的跟踪文件。

参数
subTrace File

完成追踪

public File finalizeTracing ()

报告最终跟踪文件并根据需要清理资源。

退货
File

主要贸易流程

public boolean isMainTradefedProcess ()

退货
boolean

报告跟踪事件

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

参数
categories String

name String

type PerfettoTrace.TrackEvent.Type

报告跟踪事件

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

用于执行跟踪的开始/结束的非常基本的事件报告。

参数
categories String : 与事件关联的类别

name String :事件名称

threadId int

threadName String

type PerfettoTrace.TrackEvent.Type :正在报告的事件的类型

报告线程ID

public long reportingThreadId ()

启动跟踪的线程的线程 ID。

退货
long

开始追踪

public void startTracing (boolean isSubprocess)

启动跟踪并报告跟踪的元数据。

参数
isSubprocess boolean