Status Update
Comments
mo...@google.com <mo...@google.com> #2
Thanks for your detailed post.
However, benchmark build type is under configured: at least isProfileable is not set to true for existing build type, probably there's more.
We should set isProfileable = true
by default when overriding an existing benchmark build type.
This issue is not about some specific configuration flag, but the general approach of dealing with external configuration. As a developer adopting baseline profiles, it seems extremely risky to me using a custom configuration due to how it's applied under the hood and the fact it may break default configuration.
I agree that is not great but this is a little tricky to do. For custom baseline profile build types we override all the properties. For benchmark I left it open to configure but it's mostly about these 2 properties:
isMinifyEnabled
isShrinkResources
I don't have a way to see if the user is setting them before overriding, so for this reason, I'd prefer not to. I agree with you that some other properties could be set by default to make this easier, i.e.:
isJniDebuggable = false
isDebuggable = false
isProfileable = true
The reason why I mentioned the release signing config in the beginning is because I want to use debug signing config.
In the specific of your issue, i.e. using a debug certificate can you override the benchmark and baseline profile setting? You should be able to do something like:
android {
buildTypes {
release { ... }
debug { ... }
benchmarkRelease {
...
signingConfig signingConfigs.debug
}
nonMinifiedRelease {
...
signingConfig signingConfigs.debug
}
}
}
cc...@google.com <cc...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Marcello Albano <
Link:
Added override for debuggable and profileable for benchmark builds in bpgp
Expand for full commit details
Added override for debuggable and profileable for benchmark builds in bpgp
Test: ./gradlew :benchmark:benchmark-baseline-profile-gradle-plugin:test
Bug: 369213505
Relnote: "isProfileable is always overridden in benchmark builds,
and isDebuggable is also now always overridden in both benchmark and
nonMinified (baseline profile capture) builds."
Change-Id: I487fa71083921682173f04fcbb477be5baf165f8
Files:
- M
benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/apptarget/BaselineProfileAppTargetPlugin.kt
- M
benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/apptarget/BaselineProfileAppTargetPluginTest.kt
Hash: 1906bbe52ba7ccb9ca0e1c1d6de33e7c91b5c6f0
Date: Fri Oct 11 10:07:06 2024
ap...@google.com <ap...@google.com> #4
I've landed a change that will set the following properties also when the benchmark build type already exists:
isJniDebuggable = false
isDebuggable = false
isProfileable = true
As well as the following for agp 8.0:
isDebuggable = false
I'm going ahead and closing this - if you've further questions please answer here and will reopen. Thanks.
ap...@google.com <ap...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-baseline-profile-gradle-plugin:1.4.0-alpha04
au...@google.com <au...@google.com> #6
Since release signing config is used by default instead of debug
is not mentioned in release notes - maybe this is a bug?
Cause the last time I found it mentioned in the release notes was in version 1.1
signingConfig.debug is used as the default signing config (
) b/153583269
So, if the switch to the release one indeed happened - maybe it's an issue?
cc...@google.com <cc...@google.com> #7
cc...@google.com <cc...@google.com> #8
@Aurimas - that failure is because this functionality requires running a host-side script before it will work, but fixing 2) above will fix that.
I marked the test @FlakyTest, but if there's a better way to make it not run at all in pre/postsubmit, happy to make that change.
ap...@google.com <ap...@google.com> #9
Branch: androidx-master-dev
commit 04e4b033916342deb8dc343f5dacc41f12597d0d
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Thu Aug 20 00:39:26 2020
Changes ProfilerTest#methodSamplingSimpleperf to be @Ignore instead of @FlakyTest
Since this test fails consistently, there's no value to running it in postsubmit, as it just pollutes the testing dashboard.
Bug: 158303822
Test: ProfilerTest
Change-Id: I0c9f1ffd57d0058816b838e75502807f66fef7ed
M benchmark/common/src/androidTest/java/androidx/benchmark/ProfilerTest.kt
cc...@google.com <cc...@google.com>
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit c28da961a6bffa438a957c07cc6cccb347765fb4
Author: Chris Craik <ccraik@google.com>
Date: Thu Aug 05 14:55:18 2021
Remove need for setup/post-process scripts for simpleperf, and make it default
Bug: 158303822
Test: ./gradlew benchmark:benchmark-common:cC benchmark:benchmark-macro:cC
Test: ./gradlew compose:material:material-benchmark:cC -P android.testInstrumentationRunnerArguments.androidx.benchmark.profiling.mode=StackSampling -P android.testInstrumentationRunnerArguments.class=androidx.compose.material.benchmark.CheckboxesInRowsBenchmark#draw
Relnote: Switched to Simpleperf as default sampling profiler on API 29+
Simpleperf is now the 'default' stack sampling profiler, as it doesn't
need the simpleperf setup scripts to be used on API 29+.
This CL also renames the profilers for clarity going forward.
Lowered default sampling rate to reduce liklihood of interference and
overwhelming the measure thread.
Unified logic for temporarily overriding a setprop with new
PropOverride class.
Change-Id: Ic4b346221bb91dea1e7078e369f106f9e48be1e3
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/ProfilerTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Arguments.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Errors.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Profiler.kt
A benchmark/benchmark-common/src/main/java/androidx/benchmark/PropOverride.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/simpleperf/ProfileSession.java
M benchmark/benchmark-common/src/main/java/androidx/benchmark/simpleperf/RecordOptions.java
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/PerfettoCaptureWrapper.kt
cc...@google.com <cc...@google.com> #11
Landed documentation updates with cl/406002135. Marking this as fixed, and filed
Description
Because the sampling profiler has trouble giving accurate results, the recommendation is to use simpleperf. Documentation on how to set it up would be helpful.
Making it automatic from gradle would be even more helpful, if it is possible.