2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
TraceCmdCollector
public
class
TraceCmdCollector
extends AtraceCollector
trace-cmd를 사용하여 테스트 중에 트레이스를 수집하고 호출에 로깅하는 IMetricCollector
입니다.
이 트레이스 수집기를 사용하면 테스트 중에 USB를 분리할 수 있습니다 (전원 테스트와 마찬가지로).
시스템 기본 도구인 atrace는 이 콜렉터와 함께 사용하여 Android별 sysfs 플래그를 설정합니다.
Android와 호환되는 trace-cmd (https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) 바이너리를 지정해야 합니다.
이렇게 하면 trace-cmd에서 생성한 trace.dat 형식 (man 5 trace-cmd.dat 참고)이 업로드됩니다.
요약
공개 생성자
TraceCmdCollector
public TraceCmdCollector ()
보호된 메서드
startTracing
protected void startTracing (ITestDevice device)
stopTracing
protected void stopTracing (ITestDevice device)
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 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) | |"]]