主動追蹤
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 |