主动追踪
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) 构造函数。 |
公共方法 | |
---|---|
void | addSubprocessTrace (File subTrace) 提供来自要添加到父进程的子进程的跟踪文件。 |
File | finalizeTracing () 报告最终跟踪文件并根据需要清理资源。 |
void | reportTraceEvent (String categories, String name, PerfettoTrace.TrackEvent.Type type) |
void | reportTraceEvent (String categories, String name, int threadId, String threadName, PerfettoTrace.TrackEvent.Type type) 非常基本的事件报告来执行跟踪的开始/结束。 |
void | startTracing (boolean isSubprocess) 启动跟踪并报告跟踪的元数据。 |
字段
TRACE_KEY
public static final String TRACE_KEY
公共构造函数
主动追踪
public ActiveTrace (long pid, long tid)
构造函数。
参数 | |
---|---|
pid | long :当前进程ID |
tid | long : 当前线程 id |
公共方法
addSubprocessTrace
public void addSubprocessTrace (File subTrace)
提供来自要添加到父进程的子进程的跟踪文件。
参数 | |
---|---|
subTrace | File |
完成追踪
public File finalizeTracing ()
报告最终跟踪文件并根据需要清理资源。
退货 | |
---|---|
File |
报告跟踪事件
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 : 被报告事件的类型 |
开始追踪
public void startTracing (boolean isSubprocess)
启动跟踪并报告跟踪的元数据。
参数 | |
---|---|
isSubprocess | boolean |