ActiveTrace
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
公共构造函数
ActiveTrace
public ActiveTrace (long pid, long tid)
参数 | |
---|---|
pid |
long |
tid |
long |
ActiveTrace
public ActiveTrace (long pid, long tid, boolean mainProcess)
构造函数。
参数 | |
---|---|
pid |
long :当前进程 ID |
tid |
long :当前线程 ID |
mainProcess |
boolean |
公共方法
addSubprocessTrace
public void addSubprocessTrace (File subTrace)
提供要添加到父级的子进程的轨迹文件。
参数 | |
---|---|
subTrace |
File |
finalizeTracing
public File finalizeTracing ()
报告最终轨迹文件,并根据需要清理资源。
返回 | |
---|---|
File |
isMainTradefedProcess
public boolean isMainTradefedProcess ()
返回 | |
---|---|
boolean |
reportTraceEvent
public void reportTraceEvent (String categories, String name, PerfettoTrace.TrackEvent.Type type)
参数 | |
---|---|
categories |
String |
name |
String |
type |
PerfettoTrace.TrackEvent.Type |
reportTraceEvent
public void reportTraceEvent (String categories, String name, int threadId, String threadName, PerfettoTrace.TrackEvent.Type type)
用于执行轨迹 START / END 的非常基本事件报告。
参数 | |
---|---|
categories |
String :与事件关联的类别 |
name |
String :事件名称 |
threadId |
int |
threadName |
String |
type |
PerfettoTrace.TrackEvent.Type :要报告的事件的类型 |
reportingThreadId
public long reportingThreadId ()
发起跟踪的线程的线程 ID。
返回 | |
---|---|
long |
startTracing
public void startTracing (boolean isSubprocess)
开始跟踪并报告轨迹的元数据。
参数 | |
---|---|
isSubprocess |
boolean |