自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
TracingLogger
public
class
TracingLogger
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.invoker.tracing.TracingLogger
|
可協助管理每次測試叫用追蹤記錄的類別。
摘要
公用建構函式
TracingLogger
public TracingLogger ()
公用方法
createActiveTrace
public static ActiveTrace createActiveTrace (long pid,
long tid,
boolean mainProcess)
參數 |
pid |
long |
tid |
long |
mainProcess |
boolean |
createActiveTrace
public static ActiveTrace createActiveTrace (long pid,
long tid)
為叫用作業建立並註冊有效追蹤記錄。
參數 |
pid |
long :目前的程序 ID |
tid |
long :目前的執行緒 ID |
finalizeTrace
public static File finalizeTrace ()
完成追蹤並清除追蹤記錄。
getActiveTrace
public static ActiveTrace getActiveTrace ()
傳回目前叫用作業的有效追蹤記錄,如果沒有則傳回 null。
getActiveTraceForGroup
public static ActiveTrace getActiveTraceForGroup (ThreadGroup group)
getMainTrace
public static ActiveTrace getMainTrace ()
如果存在,則會傳回 Tradefed 程序本身的目前追蹤記錄。
resetLocalGroup
public static void resetLocalGroup ()
重設本地化內容。
setLocalGroup
public static void setLocalGroup (ThreadGroup tg)
在 gRPC 伺服器中使用屬性時,追蹤本地化內容
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# TracingLogger\n=============\n\n\n`\npublic\n\n\nclass\nTracingLogger\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.invoker.tracing.TracingLogger |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nClass that helps to manage tracing for each test invocation.\n\nSummary\n-------\n\n| ### Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[TracingLogger](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#TracingLogger())`() ` |\n\n| ### Public methods ||\n|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static `[ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | ` `[createActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#createActiveTrace(long,%20long,%20boolean))`(long pid, long tid, boolean mainProcess) ` |\n| ` static `[ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | ` `[createActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#createActiveTrace(long,%20long))`(long pid, long tid) ` Creates and register an active trace for an invocation. |\n| ` static File` | ` `[finalizeTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#finalizeTrace())`() ` Finalize the tracing and clear the tracking. |\n| ` static `[ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | ` `[getActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#getActiveTrace())`() ` Returns the current active trace for the invocation, or null if none. |\n| ` static `[ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | ` `[getActiveTraceForGroup](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#getActiveTraceForGroup(java.lang.ThreadGroup))`(ThreadGroup group) ` |\n| ` static `[ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | ` `[getMainTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#getMainTrace())`() ` If it exists, returns the current trace of the Tradefed process itself. |\n| ` static void` | ` `[resetLocalGroup](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#resetLocalGroup())`() ` Resets the localized context. |\n| ` static void` | ` `[setLocalGroup](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/TracingLogger.html#setLocalGroup(java.lang.ThreadGroup))`(ThreadGroup tg) ` Tracks a localized context when using the properties inside the gRPC server |\n\nPublic constructors\n-------------------\n\n### TracingLogger\n\n```\npublic TracingLogger ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### createActiveTrace\n\n```\npublic static ActiveTrace createActiveTrace (long pid, \n long tid, \n boolean mainProcess)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------|------------------|\n| `pid` | `long` \u003cbr /\u003e |\n| `tid` | `long` \u003cbr /\u003e |\n| `mainProcess` | `boolean` \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | \u003cbr /\u003e |\n\n### createActiveTrace\n\n```\npublic static ActiveTrace createActiveTrace (long pid, \n long tid)\n```\n\nCreates and register an active trace for an invocation.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------|-----------------------------------|\n| `pid` | `long`: Current process id \u003cbr /\u003e |\n| `tid` | `long`: Current thread id \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | \u003cbr /\u003e |\n\n### finalizeTrace\n\n```\npublic static File finalizeTrace ()\n```\n\nFinalize the tracing and clear the tracking.\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------|--------|\n| `File` | \u003cbr /\u003e |\n\n### getActiveTrace\n\n```\npublic static ActiveTrace getActiveTrace ()\n```\n\nReturns the current active trace for the invocation, or null if none.\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | \u003cbr /\u003e |\n\n### getActiveTraceForGroup\n\n```\npublic static ActiveTrace getActiveTraceForGroup (ThreadGroup group)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|----------------------|\n| `group` | `ThreadGroup` \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | \u003cbr /\u003e |\n\n### getMainTrace\n\n```\npublic static ActiveTrace getMainTrace ()\n```\n\nIf it exists, returns the current trace of the Tradefed process itself.\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [ActiveTrace](../../../../../../../reference/tradefed/com/android/tradefed/invoker/tracing/ActiveTrace.html) | \u003cbr /\u003e |\n\n### resetLocalGroup\n\n```\npublic static void resetLocalGroup ()\n```\n\nResets the localized context.\n\n\u003cbr /\u003e\n\n### setLocalGroup\n\n```\npublic static void setLocalGroup (ThreadGroup tg)\n```\n\nTracks a localized context when using the properties inside the gRPC server\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------|----------------------|\n| `tg` | `ThreadGroup` \u003cbr /\u003e |"]]