Status Update
Comments
mo...@google.com <mo...@google.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
cc...@google.com <cc...@google.com>
ap...@google.com <ap...@google.com> #3
ap...@google.com <ap...@google.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
ap...@google.com <ap...@google.com> #5
Branch: androidx-master-dev
commit 42d424831e41ad853d8d4ee3e0c7e83302a181f6
Author: Chris Craik <ccraik@google.com>
Date: Wed Jun 17 11:32:08 2020
Simpleperf method sampling - initial support
Bug: 158303822
Test: ./gradlew benchmark:b-c:cC benchmark:b-j:cC
Test: ProfilerTest
Remaining simpleperf work to do:
- Additionally spit out .trace file for opening in Studio
- Use additionalOutputDir
- Enable this mode by default on supported devices (when methodSampling is selected)
- Avoid need for python prepare script (can just call ADB directly)
Additionally adds args for sample freq, and sampling duration.
The 'simpleperf' package is copied from the simpleperf app_api sample:
Change-Id: I5ccef4b434710ae6561c63c5ae1cd5d87ed77b9f
M benchmark/common/src/androidTest/java/androidx/benchmark/ProfilerTest.kt
M benchmark/common/src/main/java/androidx/benchmark/Arguments.kt
M benchmark/common/src/main/java/androidx/benchmark/BenchmarkState.kt
M benchmark/common/src/main/java/androidx/benchmark/Errors.kt
M benchmark/common/src/main/java/androidx/benchmark/Profiler.kt
A benchmark/common/src/main/java/androidx/benchmark/simpleperf/ProfileSession.java
A benchmark/common/src/main/java/androidx/benchmark/simpleperf/RecordOptions.java
au...@google.com <au...@google.com> #6
Note that androidx.benchmark.ProfilerTest#methodSamplingSimpleperf has been 100% failing in CI
java.lang.Error: linux perf events aren't enabled on the device. Please run api_profiler.py.
at androidx.benchmark.simpleperf.ProfileSession.checkIfPerfEnabled(ProfileSession.java:296)
at androidx.benchmark.simpleperf.ProfileSession.startRecording(ProfileSession.java:142)
at androidx.benchmark.simpleperf.ProfileSession.startRecording(ProfileSession.java:125)
at androidx.benchmark.MethodSamplingSimpleperf.start(Profiler.kt:174)
at androidx.benchmark.ProfilerTest.verifyProfiler(ProfilerTest.kt:56)
at androidx.benchmark.ProfilerTest.methodSamplingSimpleperf(ProfilerTest.kt:80)
at java.lang.reflect.Method.invoke(Native Method)
cc...@google.com <cc...@google.com> #7
With the patch in #5, simpleperf is supported, but it's cumbersome, and doesn't support outputting a file that Studio can read. A few things remain to make this easier to use, so we can ship externally:
1) Create Studio .trace file
Simpleperf docs explain how to convert the output <name>.data file output by simpeperf on device to a .trace file Studio can open. See
Currently, the trace file is output to /data/data/<package>/simpleperf_data/***.data
. We can leave that file there for now, so that it can be copied by simpleperf/scripts/api_profiler.py collect
, but we should put a copy of it in additionalTestOutputDir/
.
2) Replicate api_profiler.py prepare functionality
See
3) Switch MethodTracing to use simpleperf by default on supported devices
Once the above 2 are resolved, rename MethodTracing -> MethodTracingLegacy, and MethodTracingSimpleperf -> MethodTracing.
Use simpleperf by default on API 28+, but let people opt into the old version by passing "MethodTracingLegacy".
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.