Skip to content

Commit

Permalink
Add ChromeHeapSnapshotProcessor
Browse files Browse the repository at this point in the history
Summary:
Adds the `ChromeHeapSnapshotProcessor` class to `metro-symbolicate`. This is an adapter for reading and mutating a Chrome-formatted heap snapshot in-place, including safely decoding and encoding fields that point into the global string table and into enum types. There is also support for traversing tree-shaped data e.g. `trace_tree`.

This is a general, low-level design: it's mostly unconcerned with the contents/meaning of the snapshot data. It heavily relies on the fact that the heap snapshot schema is (partially) self-describing - apart from some omissions in Chrome's reference implementation, like the curious lack of a `trace_function_info_types` or `trace_node_types` field. In those cases we resort to hardcoding some small pieces of knowledge (for example: that the fields named `name` and `script_name` in `trace_function_infos` are strings).

Furthermore, `ChromeHeapSnapshotProcessor` doesn't try to expose any higher-level views, aggregations or queries not directly present in the data (although it should be possible to build those on top of this): it's simply an ergonomic read/write interface to the raw data.

This is currently unused, but in an upcoming diff I will use this to add the ability to symbolicate Chrome/Hermes heap snapshot files (`.heapsnapshot` / `.heaptimeline`).

Reviewed By: MichaReiser

Differential Revision: D26022948

fbshipit-source-id: 4381e6f21c8943f2545bdd6d55a0e62300aee7d0
  • Loading branch information
motiz88 authored and facebook-github-bot committed Jan 28, 2021
1 parent 29fc804 commit cb542c0
Show file tree
Hide file tree
Showing 2 changed files with 1,275 additions and 0 deletions.
Loading

0 comments on commit cb542c0

Please sign in to comment.