החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
TraceCmdCollector
public
class
TraceCmdCollector
extends AtraceCollector
IMetricCollector
שאוסף עקבות במהלך הבדיקה באמצעות trace-cmd, ומתעדה אותם ביומן של ההפעלה.
אוסף המעקב הזה מאפשר לנתק את ה-USB במהלך הבדיקה (כמו בבדיקת מתח).
הכלי שמוגדר כברירת מחדל במערכת, atrace, משמש בשילוב עם המלקט הזה כדי להגדיר את הדגלים של sysfs שספציפיים ל-Android.
צריך לציין קובץ בינארי של trace-cmd (https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) שתואם ל-Android.
הפקודה הזו תגרום להעלאה של הפורמט trace.dat (ראו man 5 trace-cmd.dat) שנוצר על ידי trace-cmd.
סיכום
קונסטרוקטורים גלויים לכולם
TraceCmdCollector
public TraceCmdCollector ()
שיטות מוגנות
startTracing
protected void startTracing (ITestDevice device)
פרמטרים |
device |
ITestDevice |
stopTracing
protected void stopTracing (ITestDevice device)
פרמטרים |
device |
ITestDevice |
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","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 (שעון UTC)."],[],[],null,["# TraceCmdCollector\n=================\n\n\n`\npublic\n\n\nclass\nTraceCmdCollector\n`\n\n\n`\n\n\n`\n\n`\n\n\n`\n\n`\n\nextends `[AtraceCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/AtraceCollector.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|---|---|------------------------------------------------------|\n| java.lang.Object ||||\n| ↳ | [com.android.tradefed.device.metric.BaseDeviceMetricCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/BaseDeviceMetricCollector.html) |||\n| | ↳ | [com.android.tradefed.device.metric.AtraceCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/AtraceCollector.html) ||\n| | | ↳ | com.android.tradefed.device.metric.TraceCmdCollector |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA [IMetricCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/IMetricCollector.html) that collects traces during the test using trace-cmd, and logs them to\nthe invocation.\n\nThis trace collector allows for USB disconnection during the test (as in power testing).\n\nThe system default tool, atrace, is used in tandem with this collector to set the\nandroid-specific sysfs flags.\n\nA trace-cmd (https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) binary\ncompatible with Android must be specified.\n\nThis will upload the trace.dat format (see man 5 trace-cmd.dat) produced by trace-cmd.\n\nSummary\n-------\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[TraceCmdCollector](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/TraceCmdCollector.html#TraceCmdCollector())`() ` |\n\n| ### Protected methods ||\n|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` `[LogDataType](../../../../../../../reference/tradefed/com/android/tradefed/result/LogDataType.html) | ` `[getLogType](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/TraceCmdCollector.html#getLogType())`() ` |\n| ` void` | ` `[startTracing](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/TraceCmdCollector.html#startTracing(com.android.tradefed.device.ITestDevice))`(`[ITestDevice](../../../../../../../reference/tradefed/com/android/tradefed/device/ITestDevice.html)` device) ` |\n| ` void` | ` `[stopTracing](../../../../../../../reference/tradefed/com/android/tradefed/device/metric/TraceCmdCollector.html#stopTracing(com.android.tradefed.device.ITestDevice))`(`[ITestDevice](../../../../../../../reference/tradefed/com/android/tradefed/device/ITestDevice.html)` device) ` |\n\nPublic constructors\n-------------------\n\n### TraceCmdCollector\n\n```\npublic TraceCmdCollector ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nProtected methods\n-----------------\n\n### getLogType\n\n```\nprotected LogDataType getLogType ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------------------------------------------------------------|--------|\n| [LogDataType](../../../../../../../reference/tradefed/com/android/tradefed/result/LogDataType.html) | \u003cbr /\u003e |\n\n### startTracing\n\n```\nprotected void startTracing (ITestDevice device)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|----------------------|\n| `device` | `ITestDevice` \u003cbr /\u003e |\n\n| Throws ||\n|-------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DeviceNotAvailableException](../../../../../../../reference/tradefed/com/android/tradefed/device/DeviceNotAvailableException.html) | |\n\n### stopTracing\n\n```\nprotected void stopTracing (ITestDevice device)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|----------------------|\n| `device` | `ITestDevice` \u003cbr /\u003e |\n\n| Throws ||\n|-------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DeviceNotAvailableException](../../../../../../../reference/tradefed/com/android/tradefed/device/DeviceNotAvailableException.html) | |"]]