You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add source map symbolication and source view support (#6018)
The bugzilla part of this PR:
https://bugzilla.mozilla.org/show_bug.cgi?id=2035493
This requires a Firefox that has patches applied in [bug
2035493](https://bugzilla.mozilla.org/show_bug.cgi?id=2035493). And also
it requires the "JavaScript Sources" features to be on.
It adds a pipeline that maps compiled/bundled JS frame positions back to
their original source files using source maps fetched from the browser
after profile load, similarly to our native symbolication step. And it
adds a way to see the source mapped source contents.
After this PR, the call tree, flame graph tooltip, source view, and line
timings show original TS/JS positions and function names for frames
recorded in minified bundles.
I split the work in multiple patches so it's easier to review, but
admittedly it's a lot of changes. The initial commits in the PR don't
change the behavior until the commit that wires everything up and
updates the visualization.
Example STR:
- Use a Firefox that includes my patches. And enable the "JavaScript
Sources" feature in about:profiling.
- Start the profiler
- Load an example website that has JS source maps, for example the
Firefox Profiler frontend
- Capture a profile
- Wait until symbolication and source map resolution is complete
You should then see the symbolicated functions on the frames that are
coming from Firefox Profiler source code. (Note that the react code will
still be minified as it doesn't have source maps). You should also be
able to double click on a JS function function to be able to see the
source mapped JS source.
Copy file name to clipboardExpand all lines: docs-developer/CHANGELOG-formats.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,21 @@ Note that this is not an exhaustive list. Processed profile format upgraders can
6
6
7
7
## Processed profile format
8
8
9
+
### Version 64
10
+
11
+
A new `SourceLocationTable` has been added to `profile.shared.sourceLocationTable`. It holds the original (pre-compilation) source positions produced by source map symbolication, paired with the generated `line`/`column` already on `FrameTable`.
12
+
13
+
-`source: IndexIntoSourceTable[]`: source file index. Set independently for func entries (the function's definition file) and frame entries (the execution point's file).
14
+
-`line: number[]`: 1-based line number
15
+
-`column: number[]`: 1-based column number
16
+
17
+
Two new columns were added that index into this table:
18
+
19
+
-`FrameTable.originalLocation: Array<IndexIntoSourceLocationTable | null>`: the original execution point for the frame
20
+
-`FuncTable.originalLocation: Array<IndexIntoSourceLocationTable | null>`: the original definition site for the function
21
+
22
+
A new `content: Array<string | null>` column was added to `SourceTable`.
23
+
9
24
### Version 63
10
25
11
26
A new `tooltipRows` field was added to `CounterDisplayConfig`.
0 commit comments