Fixed
Status Update
Comments
cc...@google.com <cc...@google.com> #2
I'm going to use this bug for the simple case - overriding the perfetto config entirely.
The more advanced case of Metrics contributing DataSources is tracked in
cc...@google.com <cc...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 5d5db95b1b823a1a174fbfc11fa6589c5988f378
Author: Chris Craik <ccraik@google.com>
Date: Thu Apr 11 15:04:05 2024
Enable passing custom PerfettoConfig to Macrobenchmark
Test: MacrobenchmarkTest
Test: ./gradlew benchmark:benchmark-macro:lintDebug
Fixes: 309841164
Bug: 304038384
Relnote: "Added experimental MacrobenchmarkRule#measureRepeated
variant which takes a custom PerfettoConfig for fully customized
Perfetto trace recording. Note that incorrectly configured configs may
cause built in Metric classes to fail."
Change-Id: Idfd3d0c071005f04f8be9975c6379e6095416775
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoConfig.kt
M benchmark/benchmark-macro-junit4/api/current.txt
M benchmark/benchmark-macro-junit4/api/restricted_current.txt
M benchmark/benchmark-macro-junit4/build.gradle
M benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/MacrobenchmarkRule.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
https://android-review.googlesource.com/3038761
Branch: androidx-main
commit 5d5db95b1b823a1a174fbfc11fa6589c5988f378
Author: Chris Craik <ccraik@google.com>
Date: Thu Apr 11 15:04:05 2024
Enable passing custom PerfettoConfig to Macrobenchmark
Test: MacrobenchmarkTest
Test: ./gradlew benchmark:benchmark-macro:lintDebug
Fixes: 309841164
Bug: 304038384
Relnote: "Added experimental MacrobenchmarkRule#measureRepeated
variant which takes a custom PerfettoConfig for fully customized
Perfetto trace recording. Note that incorrectly configured configs may
cause built in Metric classes to fail."
Change-Id: Idfd3d0c071005f04f8be9975c6379e6095416775
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoConfig.kt
M benchmark/benchmark-macro-junit4/api/current.txt
M benchmark/benchmark-macro-junit4/api/restricted_current.txt
M benchmark/benchmark-macro-junit4/build.gradle
M benchmark/benchmark-macro-junit4/src/main/java/androidx/benchmark/macro/junit4/MacrobenchmarkRule.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkTest.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
Description
Component used: Macrobenchmark Version used: 1.2.0 Devices/Android versions reproduced on: Android 13
We've got a project where a lot of tests with multiple runs. Executing the whole tests results in generating many Perfetto trace files. Since some scenarios take significant time those traces may occupy significant size on device's storage. And finally the storage may become exhausted.
Our aim is to try to minimize size of Perfetto traces got during Macrobenchmark run as much as possible.
Is there any way to customize in Macrobenchmark existing Perfetto configuration or specify external one to be able to manage DataSources included in resulting trace?
That would be very helpful to have such an ability. Since in test cases based on TraceSectionMetric, only a few specific tags are really required for measurement. The rest of data in the trace looks useless and could be discarded for a sake of smaller output file size.