A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release
anziché aosp-main
per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
TraceCmdCollector
public
class
TraceCmdCollector
extends AtraceCollector
Un IMetricCollector
che raccoglie le tracce durante il test utilizzando trace-cmd e le registra nell'invocazione.
Questo raccoglitore di tracce consente la disconnessione USB durante il test (ad esempio nei test di alimentazione).
Lo strumento predefinito di sistema, atrace, viene utilizzato in combinazione con questo agente di raccolta per impostare i flag sysfs specifici per Android.
Deve essere specificato un file binario trace-cmd (https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) compatibile con Android.
Verrà caricato il formato trace.dat (vedi man 5 trace-cmd.dat) prodotto da trace-cmd.
Riepilogo
Costruttori pubblici
TraceCmdCollector
public TraceCmdCollector ()
Metodi protetti
startTracing
protected void startTracing (ITestDevice device)
Parametri |
device |
ITestDevice |
stopTracing
protected void stopTracing (ITestDevice device)
Parametri |
device |
ITestDevice |
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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) | |"]]