Status Update
Comments
cc...@google.com <cc...@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
}
}
}
dv...@gmail.com <dv...@gmail.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
dv...@gmail.com <dv...@gmail.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.
cc...@google.com <cc...@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
la...@google.com <la...@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?
dv...@gmail.com <dv...@gmail.com> #8
So , I have to enlarge the trace buffer ( My device has 12GB memory), remove some trace event
Where can I get this project source code ? androidx.benchmark:benchmark-macro
cc...@google.com <cc...@google.com> #9
Did the tracing buffer increase improve the problem?
Where can I get this project source code ? androidx.benchmark:benchmark-macro
Here:
or mirrored on github:
If you want to experiment with different perfetto capture configs you can also use this API:
dv...@gmail.com <dv...@gmail.com> #10
thank you
dv...@gmail.com <dv...@gmail.com> #11
I have a question about perfetto command.
as I found that, the data sources wasn't started after just run the perfetto command so I want to use --background-wait options, to let perfetto wait data sources started , then return.
I also worry about perfetto command process would killed by lmk, so I want to use detach mode to run perfetto, but --background-wait and detach mode are mutually exclusive.
how to achieve my goal: 1、return until all data sources start, 2、 run in background
la...@google.com <la...@google.com> #12
If perfetto is started from an adb shell
, it cannot be killed by LMKD. So you can safely use --background-wait without worrying.
--detach is realy reserved exclusively for the System Tracing app and should not be used by others.
dv...@gmail.com <dv...@gmail.com> #13
dv...@gmail.com <dv...@gmail.com> #14
thank you
dv...@gmail.com <dv...@gmail.com> #15
It works after enlarge the buffer size and always use --background-wait option
( I have used wsl in windows , following the directions in
Thank you.
by the way, is there better way to simulate high system loads in android during benchmark test?
ap...@google.com <ap...@google.com> #16
Branch: androidx-main
commit 2bb16072e48a70b44cb208b2c13dbecb79ce66f3
Author: Chris Craik <ccraik@google.com>
Date: Mon Mar 18 14:48:22 2024
Use --background-wait on API 33+
Bug: 310760059
Test: ./gradlew bench:b-m:cC
Test: manually confirmed API 33 has --background-wait, 32 does not
Relnote: "Enable blocking start on Perfetto trace record to reduce
risk of missing data at beginning of trace. Only supported on API
33+."
Change-Id: Ie6e417ad248b431ebf6096e2865265d51553be7f
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
Description
Component used:MacrobenchmarkRule Version used:1.20 Devices/Android versions reproduced on: OPPO Find N3
If this is a bug in the library, we would appreciate if you could attach:
As proper marcrobenchmark, I dedicated to find out the user perceived janks.
According to some studies, it should be more than 5 consecutive jank frames, or a single jank frame that's more than 5 frames time.
And I add some loads during macrobenchmark testing.
however, when I add some loads(for example, let some app running in background, the system becomes slow, the perfetto command started /stoped by macrobenchmarkrule can't capture the full perfetto trace which happens between measureBlock.
I checked trace, found perfetto command started by macrobenchmark running in little cpu cores. That maybe the cause for the loss of perfetto trace during high system loads.
I still found that, If I keep a perfetto trace running outside macrobenchmark, It merely happens that losing the traces during marcobenchmark ?
can you fix that?