Commit Graph

47 Commits

Author SHA1 Message Date
Vasili Skurydzin
aee5fb0990 Reland "Use BigInts in processor.mjs and related code to avoid unsafe ints in calculations"
This is a reland of commit efc1a98c53

Changes since revert:
- Handle "shared-library", "code-{deopt,move,delete}", "feedback-vector", "sfi-move" events

Original change's description:
> Use BigInts in processor.mjs and related code to avoid unsafe ints in
calculations
>
> Bug: v8:13440
> Change-Id: Ie03b831b511a49fb475b9f303ef8662189bdaf3d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4017455
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84698}

Change-Id: If45d38526cab887a59f60e3becfbcb084c3d41d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4086641
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Vasili Skurydzin <vasili.skurydzin@ibm.com>
Cr-Commit-Position: refs/heads/main@{#84939}
2022-12-19 15:15:48 +00:00
Francis McCabe
72f7c31e23 Revert "Use BigInts in processor.mjs and related code to avoid unsafe ints in"
This reverts commit efc1a98c53.

Reason for revert: breaks gc stress tests: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20gc%20stress/1928/overview

Original change's description:
> Use BigInts in processor.mjs and related code to avoid unsafe ints in
> calculations
>
> Bug: v8:13440
> Change-Id: Ie03b831b511a49fb475b9f303ef8662189bdaf3d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4017455
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84698}

Bug: v8:13440
Change-Id: Ida91f184e24a09e873388cd7c6d35849a5734178
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Owners-Override: +1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4083964
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Francis McCabe <fgm@chromium.org>
Owners-Override: Francis McCabe <fgm@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#84699}
2022-12-07 01:14:08 +00:00
Vasili Skurydzin
efc1a98c53 Use BigInts in processor.mjs and related code to avoid unsafe ints in
calculations

Bug: v8:13440
Change-Id: Ie03b831b511a49fb475b9f303ef8662189bdaf3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4017455
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84698}
2022-12-06 22:06:33 +00:00
Pierre Langlois
d380c9a6df [tools][system-analyzer] Add support for apkEmbeddedLibrary and targetRootFS
The system analyzer relies on server-side processing to symbolize C++
addresses, using lws-middleware.js:

    ws --stack system-analyzer/lws-middleware.js lws-static cors

This does not work on Android however, given the log file refers to the
stripped apk file rather than the unstripped libchrome.so binary. This
CL adds the --apk-embedded-library option to the middleware script to
make this work:

    ws --stack system-analyzer/lws-middleware.js lws-static cors  \
        --apk-embedded-library=/path/to/out/android/lib.unstripped/libchrome.so

Also, for completeness, add the --target option to set targetRootFS.

Bug: v8:10644
Change-Id: I7bb73adf49e3af8eaa88a5e2c81ec913023ac1a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3823133
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82359}
2022-08-10 17:03:56 +00:00
Camillo Bruni
64aeabbc95 [tools][profile] Add support for maglev optimisation markers
Drive-by-fix:
- Rename baseline to sparkplug for consistency
- Add request timeouts for the local symbol server
- Add script to start a local symbol server
- Fix -h/--help support for linux-perf-chrome-renderer-cmd.sh

Change-Id: I4c2fc3595d672871f20fc5c4065ba45e801a1111
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3769699
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81992}
2022-07-27 08:48:25 +00:00
Camillo Bruni
00b30232ae [tools] Improve system-analyzer profiler panel
Bug: v8:10644
Change-Id: Ie14c5055a4d24d064def7435fee2cde480844e8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3717985
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81352}
2022-06-24 12:22:49 +00:00
Camillo Bruni
7a90c32032 [tools][system-analyzer] Add profiler-panel
Add basic profiler support
- Moved profiling-related helpers to profiling.mjs
- Added bottom-up profiler table
- Added mini-timeline overview wit opt/deopt events and usage graph
- Added flame-graph, pivoted on the currently selected function

Drive-by-fixes:
- Added/updated jsdoc type information
- Fixed static symbols (builtins, bytecodehandlers) that were both
  added by the CppEntriesProvider and from code-events in the v8.log
- Support platform-specific (linux/macos) dynamic symbol loader by
  adding a query path ('/v8/info/platform') to lws-middleware.js
- added css var --selection-color

Bug: v8:10644
Change-Id: I6412bec63eac13140d6d425e7d9cc33316824c73
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3585453
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80192}
2022-04-26 17:57:03 +00:00
Camillo Bruni
0c6ee45cb9 [tools][system-analyzer] Various fixes
- Fix processing lines that are longer than 1 chunk
- Add and use --code-font-size var
- Make minimum panel width 600px
- Track _lineNumber better Processor for easier debugging

Bug: v8:10644
Change-Id: I656e2ac5f0e9ba25ffa4b8c3ecc4b744144a691d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3585568
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79995}
2022-04-14 18:06:40 +00:00
Camillo Bruni
1b8d4e3adb [api] Remove FLAG_log_api
API logging has not been used in a while and we have valid alternatives:
- Runtime call stats
- Profiling
- Timer events

Together they make --log-api superfluous and we can remove it and reduce
the number of branches when calling into the V8 API.

Change-Id: Ie10f70b61ebdb82166270e7630ebcf20a27c4902
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574549
Reviewed-by: Marja Hölttä <marja@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79904}
2022-04-11 06:24:44 +00:00
Camillo Bruni
6078cb5283 [tools][system-analyzer] Various improvements
- Parse the condensed source position info support for jitted code
- Add progress bar/circle to loader
- Use temporary Array instead of concatenated strings in escapeField to
  reduce gc pressure
- Use bound functions as event handlers in more places
- Various timeline legend fixes:
  - Fix columns alignment when duration is present
  - Use fixed width to avoid breaking the UI
  - Correctly show total/percents for 'All' and 'Selection' entries
  - Improve usability of filtering buttons: added tooltips and fixed
    redrawing on filtering

Bug: v8:10644
Change-Id: I1275b31b7b13a05d9d6283d3067c1032d2d4819c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574544
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79897}
2022-04-08 19:46:22 +00:00
Camillo Bruni
190af788af [tools][system-analyzer] Speed up log parsing
Reduce the dispatching overhead in the hottest loop when parsing log-lines.

- Using a JSMap we can avoid internalizing strings
- Preprocess the dispatch table and only have varArgs or functions as
  parsers
- string[] seems to be slightly faster than string.charAt()

Bug: v8:10644
Change-Id: I03b13bdeecda1ad037191ff74e05142ceeb6533c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571890
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79816}
2022-04-06 11:31:03 +00:00
Camillo Bruni
f21e2a7f03 [tools][system-analyzer] Improve Deopt and assembly support
- Add references from CodeLogEntry to DeoptLogEntry
- Add simple basic blocks in the disassembly code view

Bug: v8:10644
Change-Id: I15f3b56751d515b902185b08f9454be3951ffa48
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3540142
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79754}
2022-04-04 14:47:59 +00:00
Camillo Bruni
656675313c [tools] Improve system analyzer
Profiler:
  - Track profiler tick durations
  - Various speedups due to low-level hacking
Improve code-panel:
  - Better register highlighting
  - Added address navigation and highlighting
  - Removed obsolete inline source-view
Improve script-panel:
  - Keep current source position focused when showing related entries
  - Better tool-tip with buttons to focus on grouped entries per
    source postion
  - Focus by default on other views when showing related entries
Improve timeline-panel:
  - Initialise event handlers late to avoid errors
  - Lazy initialise chunks to avoid errors when zooming-in and trying to
    create tooltips at the same time


Change-Id: I3f3c0fd51985aaa490d62f786ab52a4be1eed292
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3492521
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79329}
2022-03-02 13:41:32 +00:00
Camillo Bruni
1ca9a77095 [tools][system-analyzer] Add FeedbackVector support
Log FeedbackVectors for optimised code and show them in the code-panel.

Drive-by-fixes:
- Fix off-by-one in SourcePositionIteration, making sure we always show
  the last element
- Ensure we process all SourcePositions in SourcePositionIteration
- Fix first load error in script-panel
- Allow expanding all text with SHIFT-click

Bug: v8:10644
Change-Id: Ic40a36ea82f0dfa2386c3196f27ca6978cf23643
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3245931
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77567}
2021-10-27 09:40:41 +00:00
Camillo Bruni
f2d079bc97 [tools][system-analyzer] Add local symbol server
Start a local symbol server using the local-web-sever node package:
   ws --stack system-analyzer/lws-middleware.js lws-static cors

The system-analyzer will then use it to symbolize profiles.

Note: The symbol server will execute `nm` and `objdump` locally.

Change-Id: Icff6e9f5af24f214f353c049f5cd13eedccf0f88
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2979591
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75501}
2021-07-01 09:59:17 +00:00
Camillo Bruni
4a0921704a [tools][system-analyzer] Display timer events
Add common TimelineTrackStackedBase base class for TimelineTrackTick
and TimelineTrackTimer for visualising stacked time ranges that only
need rescaling when zooming in.

Additional changes:
- Highlight matching registers in disassembly
- Simplify CodeLogEntry summary for script code
- Show event for array items in the property-link-table


Bug: v8:10644
Change-Id: I0b37274e12ba55f1c6251b90d39d996ffae7f37e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2992716
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75437}
2021-06-29 11:43:02 +00:00
Camillo Bruni
899f4ccdae [tools][system-analyzer] Various fixes
- Add tests and fix Chunk calculations in Timeline class
- Cache DOM nodes directly as properties in TimelineTrackBase
- Keep track of last focused entry in timeline tracks and reuse it
  to position the tooltip when the view is locked

Bug: v8:10644
Change-Id: I356dcf7eed220df89f6a7ff926f00f78b119160e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2968943
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75224}
2021-06-17 15:45:33 +00:00
Camillo Bruni
91ddeb062c [tools][system-analyzer] Various improvements
- Show related code object for Maps
- Fix opening transition trees
- Rename *LogEntry.prototype.codeLogEntry to .code
- Show Arrays as dropdowns in tooltips
- Avoid hiding the tooltip when clicking on the tooltip itself
- Show links to code variants (bytecode/baseline/optimized)
- Fix chunk offset calculation
- Fix code for browsers that don't support
  navigator.scheduling.isInputPending

Bug: v8:10644
Change-Id: I858dc410657d26d076214368814a52177b124f4c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2964592
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75169}
2021-06-16 07:22:46 +00:00
Leszek Swirski
1ac40e69e8 [system-analyzer] Support inline scripts
Inline scripts share the same URL, so lookup of script by URL on them
can give the wrong result. Also, their source positions are relative to
the start of the HTML file, so we need to infer the starting line from
the Script's compilation event.

As a drive-by, fix the tooltip to lock in-place on click.

Change-Id: I5db6d35b0fbd2521531e48c34dea44b43b65ca4a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2963592
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75153}
2021-06-15 13:40:09 +00:00
Camillo Bruni
26b56ba664 [tools][system-analyzer] Fix linked events
- Open and focus separate views for each log entry
- Map.prototype.parent is now a getter
- Fix SharedLibLogEntry tooltips
- Store codeEntry in IcLogEntry for linking back to code objects
- New property-link-table which is used in tooltip and code-panel
- Ignore right-click events in the timeline-tracks

Bug: v8:10644, v8:11835
Change-Id: Id2fe5002b776adf362b1580b96082c84790a6ef0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2960804
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75150}
2021-06-15 12:22:08 +00:00
Leszek Swirski
423f38ab01 [system-analyzer] Process shared-library events
Add a new LogEntry for sharedlib PCs

Change-Id: I4f7fdca93a9905e41b73347df475dffcb84bcb89
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2959620
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75125}
2021-06-14 10:43:27 +00:00
Leszek Swirski
0e9f9aabfd [system-analyzer] Use Streams API for log files
Use the Streams API for file Blobs, instead of FileReader, to allow
large files to be loaded in chunks.

Change-Id: I241e0daff3f9c3d491dde2f3e8e52ea2236f05be
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2953286
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75095}
2021-06-11 11:07:08 +00:00
Camillo Bruni
72eb1ca18d [tools][system-analyzer] Switch to SVG rendering + various improvements
- Introduce proper TickLogEntry and use a separate Timeline object
- Update the main rendering to use SVG for speed
- Separate custom-elements: timeline-track-map and timeline-track-tick
- Revamp flame-chart drawing
- Enable map-transitions overlay
- Use mouse position to infer current log-entry instead of individual
  event handlers
- Fix first timelineLegend column header
- Fixing scrollbar-color for FireFox

Change-Id: I7c53c13366b3e4614b1c5592dfaa69d0654a3b5f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2944430
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74987}
2021-06-07 15:44:30 +00:00
Camillo Bruni
8ff6a214b1 [tools][system-analyzer] Support profiling ticks
This adds a first crude version of displaying a flamechart in the
system-analyzer.

- Basic function types are distinguishable by colors.
- Tooltip information is available as well

Bug: v8:11835
Change-Id: I87e092f749d4c16aa5017af39df8d2f7bd7e2edd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2928179
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74860}
2021-05-31 13:09:16 +00:00
Camillo Bruni
a6c474fecc [tools][system-analyzer] Add ToolTip API
Enable more complex tooltips with clickable links and references.

- Use short filename for Script.name if they are unique
- Use shared App.isClickable method
- Remove various toStringLong methods
- Rename CodeLogEntry.disassemble to .code
- Add DOM.button helper

Bug: v8:10644
Change-Id: I5d46ffd560b37278dc46b8347cb9ff0a7fdfa2ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2916373
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74746}
2021-05-25 12:43:52 +00:00
Camillo Bruni
9a068b9f09 [tools] System analyzer: fix parsing linlined deopt location
Change-Id: I424e4de75cfd628d034033c99ce2a6e7b88c6a52
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2857958
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74269}
2021-04-29 09:33:03 +00:00
Camillo Bruni
1497a3cbf2 [tools] System-analyzer select code related events
Prepare the system analyzer to be able to select events related to a
a single code log entry.

- Rename source-panel to script-script panel
- Update main index.css to support selects in the panel selection
  header

Bug: v8:10644
Change-Id: Ie8dd1839294687cb9e25995bcb7ef246a7d7f48d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2604707
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71948}
2021-01-07 13:41:23 +00:00
Camillo Bruni
43a5f208b7 [tools] Fix system-analyzer deopt position
Associate DeoptLogEntry with both, the function's source position and
the deopt location's source position.

Also fixes the list-panel click handler to support all clickable entry
types.

Bug: v8:10644, v8:10754
Change-Id: If10272a926d5dad10b29322e237610900715b9dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2584955
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71732}
2020-12-14 10:10:29 +00:00
Camillo Bruni
0f9bf544da [tools] System-analyzer improvements
- Display the source code in the code-panel
- Add selection dropdown to code-panel
- Add more filter propertyNames to CodeLogEntry
- Rename list panel titles to "XXX List"
- Add +10, +100 buttons for LazyTables
- Add Color.darken

Change-Id: Ia41c41c1d6cc949dfe766397ba6b72edc29797aa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2578945
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71674}
2020-12-09 09:53:18 +00:00
Camillo Bruni
88f7740636 [tools] Add system-analyzer list view
Bug: v8:10644
Change-Id: I83801396fe683173349d14a7590828ec86587eac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2575122
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71655}
2020-12-08 12:26:24 +00:00
Camillo Bruni
1d7aa2f8d0 [tools] Add api events timeline-track to system-analyzer
- Clean up entry selection code
- Add source positions for code and deopt events
- Fix log entry selection from script
- Improve log parsing speed

Bug: v8:10644
Change-Id: Ie466679132b8ce24506ecf75223118b32275f931
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569756
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71624}
2020-12-05 10:49:42 +00:00
Camillo Bruni
02ab03b9e8 [tools][runtime] Fix --trace-maps
- Don't print normalize transition for cached maps
- Avoid printing two transitions in Map::CopyReplaceDescriptor
- Harden processor.mjs existing existing broken logs by skipping double
  entries and avoiding mutliple edges to the same target map

Bug: v8:10644
Change-Id: I561a0f888c8835a40a289baa50d65ff69e368bad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565123
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71565}
2020-12-02 13:25:49 +00:00
Camillo Bruni
c899ad5e5e [tools][log] Add support for disassembled code
- Add FLAG_log_code_disassemble
- Add code-disassamble log entries for Code and BytecodeArray
- Add basic code-panel to system-analyzer

Bug: v8:10644
Change-Id: I1abb339a42b55df01265d63d0f0d8c1ac2e041dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565517
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71556}
2020-12-02 08:37:39 +00:00
Camillo Bruni
c0f72de764 [tools] Extend optimizations markers
This CL extends the existing optimization markers:

- "~" for interpreted code
- "-" for native context independent code (new)
- "+" for turboprop code (new)
- "*" for turbofan code

Bug: v8:10644
Change-Id: If8940a8c3f32c6f347f61a901be101078df66331
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567693
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71541}
2020-12-01 18:30:01 +00:00
Camillo Bruni
f60ccbf57c [tools] Use profiler code-source-info in processor.mjs
Attach SourcePositionInfo objects to existing code entries if we find
code-source-info log entries. This improves fixes finding scripts for
anonymous functions.

Bug: v8:10644
Change-Id: I6fc1e029b17107cacce89dc74a67d4d448d9a979
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2562672
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71482}
2020-11-30 11:34:49 +00:00
Camillo Bruni
79896eeb4b [tools] Add code-creation timeline track to system-analyzer
Drive-by-fix:
- better handle tooltip text

Bug: v8:10644
Change-Id: Ibe20a1e0a0ebd298855afcbdc6f28e6fa4d1e64e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2563660
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71479}
2020-11-30 11:19:08 +00:00
Camillo Bruni
400b6e7f9d [tools] Modernize tools .mjs files
This is mostly an auto-conversion done by several tools.

- use let / const
- use arrow functions
- use template strings

There are some additional manual rewrite required to modernize the
code further.

Change-Id: I63a7a43b05b14b33ad9941350d3d5f26aab10ba0
Bug: v8:10667
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2519564
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71080}
2020-11-10 12:32:26 +00:00
Sathya Gunasekaran
91ace57f43 Reland "[presubmit] Add JS formatting for tools/system-analyzer"
This is a reland of 1ec8f1da4f

Original change's description:
> [presubmit] Add JS formatting for tools/system-analyzer
>
> Bug: v8:10670
> Change-Id: Ifb653ada003719faff261b6e5b2169db37cffdaf
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2282522
> Reviewed-by: Tamer Tas <tmrts@chromium.org>
> Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68909}

Bug: v8:10670
Change-Id: I4903b3eb8ff39a76594324076f0840b06290044e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2307229
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70938}
2020-11-03 09:18:49 +00:00
Camillo Bruni
58c65035c2 [tools][system-analyzer] Clean up ICPanel and add DOM helper
- Move all createElement helpers onto a separate DOM class
- Make ICPanel.update async
- Show number of selected IC events in the ICPanel header
- Use shared bound functions for event listeners in the ICPanel groups
- Use triangle to mark opened and closed ICPanel groups
- Use global --border-color CSS variable

Bug: v8:10644
Change-Id: Ib35d94db1019d5cdcee057f0f047472f478ab3be
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2507718
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70919}
2020-11-02 13:55:10 +00:00
Camillo Bruni
213152dd77 [tools] Remove outdated ic-processor
- Remove ic-processor.html since it's been fully integrated in the
  system-analyzer
- Use new tools/system-analyzer/processor.mjs for command line
  ic-processor
- Update tools landing page
- Partially fix dependencies on web specific components in helper.mjs

Bug: v8:10644
Change-Id: I0c99ff7c7859684e53aa3ab22489b1a8242e1a6e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2498606
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70799}
2020-10-27 14:21:45 +00:00
Camillo Bruni
7413658cef [tools] Improve system-analyzer
- Fix State timerange adjustment for multiple timelines
- Fix grid layout for detail panels
- Style panels consistently
- Simplify file-reader html

Bug: v8:10644
Change-Id: I277d88e2deb2bf71b0204034f6e63ea35f85a791
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2485812
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70653}
2020-10-20 12:23:09 +00:00
Camillo Bruni
554b49238f [tools] Add deopt support for system-analyzer
Drive-by-fix:
- fix legend formatting
- Fix color from type retrieval
- Partially fix file location parsing in Processor

Bug: v8:10644
Change-Id: I8d9ecc4923c9772de66da74e9440b293fcecc5e2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2465831
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70608}
2020-10-19 13:14:01 +00:00
Camillo Bruni
4029804155 [tools] Make sure system analyzer works in FF and Safari
- Avoid private fields (using _xyz instead of #xyz)
- Avoid static fields on classes

These are temporary changes that eventually will be reverted
once FireFox and Safari support it.

Bug: v8:10644
Change-Id: I3d757251eaedef92751970d866882c3d912c7e3e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2464924
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70607}
2020-10-19 11:57:28 +00:00
Camillo Bruni
aaeca0dc53 [tools] System-analyzer cleanups
- Use *LogEntry in more places to avoid confusion with HTML Events
- Move Processor.kProperties to IcLogEntry.getPropertyNames
- Move timeline-track legend "All" entry to the end

Bug: v8:10644
Change-Id: I5a9e833ad0570c39d3106955fa2ba00af53b7062
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2463241
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70606}
2020-10-19 10:52:48 +00:00
Camillo Bruni
94bce1dcac [tools] Convert JS-tools to ES6 modules
This changes all tools to use ES6 modules and proper imports.

Step 1: Add converted .mjs files (*this CL*)
Step 2: Update node-ci build to use new .mjs files
Step 3: Remove outdated .js files

Bug: v8:10667, v8:10933
Change-Id: I3e92e66f896d8a9cacaf6d421f8d2c86fb3bc444
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431045
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70163}
2020-09-28 14:40:18 +00:00
Camillo Bruni
89e0d45c66 [tools] Add markers to system-analyzer source panel
- Create SourcePosition objects for Map and IC log entries
- Display source code with markers for SourcePositions
- Avoid some try-catches for a better debugging experience

Bug: v8:10644
Change-Id: I559b0eaeaa1442986a00d2ef720d19ba85178509
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2424258
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70091}
2020-09-23 13:06:11 +00:00
Zeynep Cankara
78b04f24d0 [tools][system-analyzer] Unify map-processor and ic-processor
This CL unifies the map-processor and ic-processor into a
single log processing pipeline. Unified processing pipeline
prevents doing 2 pass over the data.

Bug: v8:10644

Change-Id: Ic0221a9bb32901f43202390b98fded4830a50f70
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2385496
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69676}
2020-09-02 13:59:18 +00:00