主动跟踪
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 |