Status Update
Comments
cc...@google.com <cc...@google.com> #2
What version of kotlin are you using?
ml...@google.com <ml...@google.com> #3
1.7.10
ys...@google.com <ys...@google.com> #4
related
ys...@google.com <ys...@google.com> #6
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Iguana | 2023.2.1 Canary 6
- Android Gradle Plugin 8.3.0-alpha06
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
be...@google.com <be...@google.com> #7
I agree that visualizing this would be nice to have. We haven't actively maintained or looked into this for the performance samples in a while.
ml...@google.com <ml...@google.com> #8
Profiler provides a way to export any trace file, i.e., option b) in
. This isn't ideal IMHO ... comment #1
The files aren't overwritten by the next macrobenchmark run.
You can open traces in Studio Profiler from the test history results even without opening it first from the profiler. The benchmark results probably are copied to /tmp
even before opening with the profiler.
But anyway, I know it's not ideal to open a profiler just to save the file. From my perspective it was just to have some way that might be implemented faster and come up with the more robust solutions later.
Alternatively to saving from the profiler, saving/copying the file from the context menu (right-click on a trace)
It would be good to be able to submit them to a server, say posting to a locally hosted ui.perfetto.dev and generating permalinks. Since that's been my flow...
Yeah, exactly. Currently you need to copy the results yourself before running another benchmark otherwise you loose them.
sh...@google.com <sh...@google.com> #9
The files aren't overwritten by the next macrobenchmark run. You can open traces in Studio Profiler from the test history results even without opening it first from the profiler. The benchmark results probably are copied to /tmp even before opening with the profiler.
Sorry I wasn't clear. I was talking about the overwritten happens at build/outputs/connected_android_test_additional_output/**
. It's likely the Test Results feature in Studio has copied the files to somewhere, so the profiler can open them later. The FileUtil.createTempFile()
line in /tmp
.
cc...@google.com <cc...@google.com> #10
Please note that Profiler makes a copy of the trace file only if the developers has asked to open it
The FileUtil.createTempFile() line in
is running only when the users attempt to open it, which copies the file to /tmp. comment #5
Is that separate from the file pull destination? I see file names like /tmp/CpuCounterBenchmark_fullIteration_2023-03-02-22-25-26.perfetto-trace
, which is missing the "cpu_trace_" prefix and ".trace" suffix. I think the "cpu_trace_" version of the file gets created on opening in the profiler in /tmp
, but I see the original, not renamed files show up simply when the test method completes, without clicking the benchmark trace links.
sh...@google.com <sh...@google.com> #11
I think you are right Chris. Looks like both Test Results and Profilers are copy files to /tmp
on Linux. Profiler's copy has a name like cpu_trace_*.trace
.
ml...@google.com <ml...@google.com> #12
Just a revive ping here.
Is there anything we can do here (relatively cheaply?). We've heard from go-no-go that Baseline Profiles (and benchmarks) are disconnected from the Android Studio flow and I think this might be one of the smaller things that adds up to the overal picture.
sh...@google.com <sh...@google.com>
yd...@google.com <yd...@google.com>
cc...@google.com <cc...@google.com> #13
yd...@google.com <yd...@google.com> #14
The ability to export the traces taken from Macrobenchmark (from the sessions panel) will be available now in Android Studio Iguana Canary 5.
yd...@google.com <yd...@google.com> #15
The UX/solution pursued in the fix is that of route (b) as outlined in the bug description. The save icon (as done for artifacts in the regular Profiler) will now appear under the Session corresponding to the selected trace taken by the Macrobenchmark. A user can click on this icon (that appears on hover) and save the file to disk.
@ml...@google.com please verify that this is the desired behvaior.
an...@google.com <an...@google.com> #16
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Iguana | 2023.2.1 Canary 5
- Android Gradle Plugin 8.3.0-alpha05
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
ml...@google.com <ml...@google.com> #17
Thanks for fixing this. I can see the icon.
I have a question -- can we preserve the original filename?
VerticalScrollBenchmark_benchmarkLazyGridCompFull_iter000_2023_09_25_08_11_09.perfetto-trace
is the opened trace file while when downloading it's called cpu-perfetto-20230925T104037.trace
I assume the different suffix doesn't matter .perfetto-trace
vs .trace
(Created a bug for how to prevent overwriting the folder here
ml...@google.com <ml...@google.com> #18
ml...@google.com <ml...@google.com> #19
Created a follow up
an...@google.com <an...@google.com> #20
Further fixes for this issue are now available in:
- Android Studio Iguana | 2023.2.1 Canary 7
- Android Gradle Plugin 8.3.0-alpha07
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
[Deleted User] <[Deleted User]> #21
So we see:
2024-05-23 12:09:48.867 19537-19565 Benchmark com.navenio.ils.benchmark D Moving /storage/emulated/0/Android/media/com.navenio.ils.benchmark/com_navenio_ils_benchmark-benchmarkData.json to /sdcard/Android/media/com.navenio.ils.benchmark/additional_test_output/com_navenio_ils_benchmark-benchmarkData.json
However the folder (/sdcard/Android/media/com.navenio.ils.benchmark/additional_test_output) is deleted at the end of the MacroBenchmark and I have yet to see how to stop it deleting the App.
Managing to copy off the runs by watching in Device Explorer has a folder with all the Perfetto traces.
In case it's Android version specific, this is running the benchmark on a real Pixel 6 Pro running Android 15 Beta 2.
I forgot to say AGP is :
classpath 'com.android.tools.build:gradle:8.4.1'
AS:
Android Studio Jellyfish | 2023.3.1
Build #AI-233.14808.21.2331.11709847, built on April 12, 2024
Runtime version: 17.0.10+0-17.0.10b1087.21-11572160 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.5
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
ide.instant.shutdown=false
Non-Bundled Plugins:
wu.seal.tool.jsontokotlin (3.7.4)
idea.plugin.protoeditor (233.14808.14)
com.jetbrains.kmm (0.8.2(233)-8)
Description
When running macrobenchmarks from Studio, traces and results can be accessed from
build/outputs/connected_android_test_additional_output/**
. The problem is that with every test run, the results are cleared, therefore you can't access traces from the previous run.However, results in test history are kept (https://screenshot.googleplex.com/6Mn83y7c6ZnABTB ) and the links to traces from the history work and open the traces in studio.
Is it possible to either:
a) access the linked trace files from somewhere? (I tried searching them in the studio folders, but couldn't find them)https://screenshot.googleplex.com/coTUdDf5HbA9wQE
b) download / copy any trace from studio profiler? Similarly as you can save the trace file when you run a profiler directly from studiohttps://screenshot.googleplex.com/5vCZo8aQ5JPjVZ7