I wanted to trace the CPU and memory utilization of one of my algorithm on a mobile device. So far I have implemented it in Android as an app and collected the resource utilization trace using Android profiler as a trace file (filename.trace). I have tried using the tool, perfetto UI which displays the trace like this:
How can I extract the original time series data which are being displayed in the android studio like the one below from this trace file?
If I understand your question correctly, you want to see the CPU utilization chart in Perfetto UI?
The short answer is no, because they're different data.
Long answer: what Android Studio profiler shows in the chart is somewhat different:
proc/[pid]/stat
, not from system trace (or Perfetto). That means the trace file you exported from Android Studio does not contain that data. It's lost when you exit Android Studio.time_spent_in_app_per_50_miliseconds / 50_miliseconds * cpu_core_count
.