google / google/perfetto

Perfetto Chromium Trace Capture should support capturing / exporting to DevTools (bug?)

Open
#277 23 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
6.5k
Forks
868
Avg merge
2d 1h
Merged PRs (30d)
218

Description

Scenario: Devs sometimes use Chromium F12 Dev Tools Perf tab to diagnose performance and see Tasks, or MicroTasks with no additional detail. Perfetto should be the next goto option when needing to dig further into Chromium internals. It is somewhat the next logical goto solution today, but there are gaps, and it's not a superset with at least respect to trace capture (due to a set of bugs?)

Proposal: Perfetto Chromium Trace Capture should support capturing / exporting to DevTools. (BTW I think this is the intention today but it seems partially broken)
Result: Devs should be able to easily select a top-level UI option for DevTools which enables devtools categories (devtools.*) and another top-level UI option for JS V8 Stacks (v8.cpu_profiler, v8.runtime_stats_sampling). While Perfetto analysis / timeline might not be able to support / show these, at least the JSON export and import to F12 dev tools should work. Meaning screenshots & JS stacks - along with key browser threads should work in F12 dev tools, while Perfetto shows the extra detail and devs investigating Chromium perf do not have to sacrifice any information between the 2 tools. This flow DOES NOT fully work today.

Context: It seems that the tracing probes and infrastructure are highly shared between F12 perf dev tools & Perfetto. Such that devs cannot capture a F12 Perf trace (with screenshots, JS stacks) AND a Perfetto trace at the same time. So in order to capture all the detail, they need to capture a Perfetto Chromium trace. However, in this flow JS stacks & devtools screenshots are missing. This means they are missing out on key contextual features that were useful (even in export scenario) and while capturing more detailed Chromium internals, they are losing other info & features.

Perfetto can export to JSON and load the JSON as profile in F12 Perf Tab

It seems F12 Dev Tools [enables some categories](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/devtools/front_end/timeline/TimelineController.js;drc=977fa8c33a878dd5e9f33ef5aa036aff86932e24;l=46) that Perfetto UI Chrome tracing supports. Things like these categories

- v8.runtime_stats_sampling
- v8.cpu_profiler
- devtools.*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.