Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit c58f2273e4704c9e4541d7902e64be5ed2ed10a0
Author: Chris Craik <ccraik@google.com>
Date: Thu Jul 27 16:01:53 2023
Fix in memory tracing to show up in Studio, and tie to correct thread
Fixes: 293510459
Test: LazyListScrollingBenchmark#scrollProgrammatically_noNewItems
Test: InMemoryTracingTest
Relnote: """Benchmark internal tracing (including microbenchmark
loop/phase tracing) will now show up in Studio system trace viewer,
and nest under the correct process in Perfetto."""
Renames UserspaceTracing -> InMemoryTracing and makes recording inside
recorded micro/macro Perfetto traces automatic.
Connects trace events to correct pid/tid so they don't get hidden in
misc global tracks in perfetto, and so they can be displayed in
Studio.
Also corrects label in micro to no longer be "macrobenchmark".
Change-Id: I6b2e7690d366b92407c1845095feccc29b059a05
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/InMemoryTracingTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkState.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/InMemoryTracing.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/MetricsContainer.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkPhase.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCapture.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
M benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/BaselineProfiles.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/CompilationMode.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MethodTracing.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/server/PerfettoHttpServer.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/perfetto/PerfettoTraceProcessor.kt
https://android-review.googlesource.com/2681237
Branch: androidx-main
commit c58f2273e4704c9e4541d7902e64be5ed2ed10a0
Author: Chris Craik <ccraik@google.com>
Date: Thu Jul 27 16:01:53 2023
Fix in memory tracing to show up in Studio, and tie to correct thread
Fixes: 293510459
Test: LazyListScrollingBenchmark#scrollProgrammatically_noNewItems
Test: InMemoryTracingTest
Relnote: """Benchmark internal tracing (including microbenchmark
loop/phase tracing) will now show up in Studio system trace viewer,
and nest under the correct process in Perfetto."""
Renames UserspaceTracing -> InMemoryTracing and makes recording inside
recorded micro/macro Perfetto traces automatic.
Connects trace events to correct pid/tid so they don't get hidden in
misc global tracks in perfetto, and so they can be displayed in
Studio.
Also corrects label in micro to no longer be "macrobenchmark".
Change-Id: I6b2e7690d366b92407c1845095feccc29b059a05
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/InMemoryTracingTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkState.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/InMemoryTracing.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/MetricsContainer.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkPhase.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCapture.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoHelper.kt
M benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/BaselineProfiles.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/CompilationMode.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/Macrobenchmark.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MethodTracing.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/server/PerfettoHttpServer.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/perfetto/PerfettoTraceProcessor.kt
na...@google.com <na...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-common:1.2.0-beta03
androidx.benchmark:benchmark-junit4:1.2.0-beta03
androidx.benchmark:benchmark-macro:1.2.0-beta03
androidx.core:core-testing:1.12.0-rc01
Description
Perfetto UI has hidden tracks unaffiliated with processes by default, so we should be sure to associate our synthetic track with a process (which can also make it visible within android studio).