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