Commit Graph

27 Commits

Author SHA1 Message Date
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
0f6afbe125 [tools][system-analyzer] Add Source Code Panel
This CL adds a source code panel to display source code positions of
Map/IC log events.

* Clicking file positions on the Ic Panel emits FocusEvent with
SourcePositionLogEvent as entry to highlight code related with the
selected icLogEvent.

* Clicking map details on the Map Panel emits FocusEvent with
SourcePositionLogEvent as entry to highlight code related with the
selected mapLogEvent.

Bug: v8:10644
Change-Id: Icaf3e9e3f7fae485c50ad685f9ec5dc8ac28b3dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2358734
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69610}
2020-08-28 15:20:21 +00:00
Zeynep Cankara
a57270cfcc [tools][system-analyzer] Format sources and relative css import
Action items:
* Replace alls css @import with link tags.
* Format all sources in system-analyzer/*.

Bug: v8:10644

Change-Id: I6354cf7b0ed2aca8cdab4888cf9d504a1d963b50
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2367869
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69545}
2020-08-25 07:10:03 +00:00
Tobias Tebbi
58b45cca2f [profiler] fix 4 bugs in --prof/linux-tick-processor
- In log.cc, we used InstructionStart() for code create events, but
  the Code object address for code move events. Change to use
  InstructionStart() for both.
- The symbol table contains some kind of virtual address, not file
  offsets. They happened to be identical in the past but are no longer,
  probably due to toolchain changes. Now we use objdump to figure out
  the difference between virtual addresses and file offsets.
- When a new code object happened to be created at the same address as
  a previous one, we wouldn't update it.
  This is indeed wrong, as predicted in a TODO by Jaro.
- For 64bit addresses, using >>> is wrong, now replaced with division.


Change-Id: Ib23114ed736f98bfc33c65004a039a3fd04d3c49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2016586
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66145}
2020-02-06 10:38:34 +00:00
Jaroslav Sevcik
88a444baa2 [profview] Avoid treating embedded builtins as CPP code.
Instead attribute them properly as Bultin or BytecodeHandler.

Bug: v8:6240
Change-Id: I773a533b318afe52d63152edf5b16463801db8e9
Reviewed-on: https://chromium-review.googlesource.com/1249202
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56262}
2018-09-27 12:14:15 +00:00
Bret Sepulveda
b9cb78a705 profview: View source code of functions with samples inline.
If profiling is done with --log-source-code profview will now display
a "View source" link for each function in the tree view. Clicking this
will show a new source viewer, with sampled lines highlighted. See the
associated bug for screenshots.

This patch also fixes a bug in the profiler where the source info of
only the first code object for each function would be logged, and
includes some refactoring.

Bug: v8:6240
Change-Id: Ib96a9cfc54543d0dc9bef4657cdeb96ce28b223c
Reviewed-on: https://chromium-review.googlesource.com/1194231
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55542}
2018-08-31 11:32:33 +00:00
Bret Sepulveda
29879461ce Stop manual unescaping of script source data when preprocessing logs.
It appears that the fields are already being unescaped elsewhere,
perhaps by the JSON writer. So if we unescape when adding the source
filename and contents, unescaping will happen again later and plain
backslashes will be interpreted as escape codes.

Bug: v8:6240
Change-Id: Ic66b9017ae685d6dd12944ee8d254991e26fbd32
Reviewed-on: https://chromium-review.googlesource.com/1186625
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55401}
2018-08-24 12:30:48 +00:00
Jaroslav Sevcik
92d13a12fc [profiler] Add script name to v8.log with --log-source-code.
This also changes logging of code address to Code::instruction_start rather
than Code::address().

Bug: v8:6239
Change-Id: I4ef975630574e23409123468a3f7fb8fe6ad39e7
Reviewed-on: https://chromium-review.googlesource.com/605887
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47266}
2017-08-10 04:43:43 +00:00
Jaroslav Sevcik
b87ba9f2f8 [logging] Add an option to log source code in v8.log.
Bug: v8:6239
Change-Id: I87f72cb97616e28cb44f7160d5170ff740422419
Reviewed-on: https://chromium-review.googlesource.com/584612
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46958}
2017-07-28 07:18:18 +00:00
mvstanton
278688135f [Ic-Processor] Let us know if an IC is in opt. or unopt. code.
Traditionally, we had a prefix for a function name of "~" for
unoptimized code and "*" for optimized code. Restore this prefix
in v8/tools/ic-processor. It's really cool to know if an IC was
called from optimized code (often a hint of poor performance!).

NOTRY=true
R=cbruni@chromium.org

Review-Url: https://codereview.chromium.org/2835923004
Cr-Commit-Position: refs/heads/master@{#44846}
2017-04-25 12:01:18 +00:00
jarin
12d815b36e [profiler] Web UI: add summary of opts/deopts.
This adds optimization and deoptimization counts to the Web UI. Also, the function timeline
now shows optimization and deoptimization marks.

Review-Url: https://codereview.chromium.org/2753543006
Cr-Commit-Position: refs/heads/master@{#44033}
2017-03-22 16:02:25 +00:00
leszeks
0956e58792 [tools] Manually write JSON in profile.js to avoid huge strings
In the tick processor, in cases where there are a lot of ticks (e.g.
long running programs), JSON.stringify could throw a range exception
because the created string is too large.

Instead of creating the entire JSON string in memory, we now write the
top-level parts of the JSON manually, writing out the ticks individually
instead of all together.

Review-Url: https://codereview.chromium.org/2754683002
Cr-Commit-Position: refs/heads/master@{#43973}
2017-03-21 10:58:24 +00:00
jarin
fcce4797bc [profiler] Graphical front-end for tick processor.
Improvements:
- top-down call tree.
- interactive restriction to time interval.

Review-Url: https://codereview.chromium.org/2696903002
Cr-Commit-Position: refs/heads/master@{#43599}
2017-03-04 13:04:58 +00:00
jkummerow
feffccca22 Profiler improvements
(1) --prof-cpp: Collects ticks like --prof, but ignores code creation events to reduce distortion (so all JS ticks will be "unaccounted"). Useful for profiling C++ code.
(2) --timed-range flag for tick processor: Ignores ticks before the first and after the last call to Date.now(). Useful for focusing on the timed section of a test.

Review URL: https://codereview.chromium.org/802333002

Cr-Commit-Position: refs/heads/master@{#26168}
2015-01-20 16:06:09 +00:00
jkummerow@chromium.org
c186399e5f Tick processor: Print C++ entry points
R=loislo@chromium.org, yangguo@chromium.org, yurys@chromium.org

Review URL: https://codereview.chromium.org/638633002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24700 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-17 15:44:02 +00:00
mikhail.naganov@gmail.com
57b9e9d968 Revert accidental r9229 and r9230
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9231 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-12 10:50:40 +00:00
mikhail.naganov@gmail.com
81ebd86817 do not use code deletions
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-12 10:42:15 +00:00
mikhail.naganov@gmail.com
5c57d0d643 Remove support for logging into a memory buffer.
The only usage of it was in logging tests, I've switched them for
using a file.

I've left out support for "--logfile=*" for now, as Chromium uses it.
Will be removed after the next V8 roll.

R=sgjesse@chromium.org
BUG=859
TEST=mjsunit/log-*

Review URL: http://codereview.chromium.org/7310025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8629 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-13 11:31:22 +00:00
mikhail.naganov@gmail.com
56788625b6 Fix CPU profiling for Crankshaft.
The main issue was due to multiple recompilations of functions.  Now
code objects are grouped by function using SFI object address.
JSFunction objects are no longer tracked, instead we track SFI object
moves. To pick a correct code version, we now sample return addresses
instead of JSFunction addresses.

tools/{linux|mac|windows}-tickprocessor scripts differentiate
between code optimization states for the same function
(using * and ~ prefixes introduced earlier).

DevTools CPU profiler treats all variants of function code as
a single function.

ll_prof treats each optimized variant as a separate entry, because
it can disassemble each one of them.

tickprocessor.py not updated -- it is deprecated and will be removed.

BUG=v8/1087,b/3178160
TEST=all existing tests pass, including Chromium layout tests

Review URL: http://codereview.chromium.org/6551011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6902 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-22 16:31:24 +00:00
mikhail.naganov@gmail.com
12e62e7154 Shorten constructor names in JS tickprocessor.
As they are no more used in DevTools profiler, there is no
need to prefix them with "devtools.profiler" namespace.

Review URL: http://codereview.chromium.org/6456025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6712 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-10 07:47:28 +00:00
mikhail.naganov@gmail.com
999e3fca90 Fix issue 553: function frame is skipped in profile when compare stub is called.
The problem appeared due to a fact that stubs doesn't create a stack
frame, reusing the stack frame of the caller function. When building
stack traces, the current function is retrieved from PC, and its
callees are retrieved by traversing the stack backwards. Thus, for
stubs, the stub itself was discovered via PC, and then stub's caller's
caller was retrieved from stack.

To fix this problem, a pointer to JSFunction object is now captured
from the topmost stack frame, and is saved into stack trace log
record. Then a simple heuristics is applied whether a referred
function should be added to decoded stack, or not, to avoid reporting
the same function twice (from PC and from the pointer.)

BUG=553
TEST=added to mjsunit/tools/tickprocessor

Review URL: http://codereview.chromium.org/546089

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-21 16:42:41 +00:00
mikhail.naganov@gmail.com
37d3972429 Fix issue 571: display descriptive names for code objects from snapshot.
As this is only needed for internal profiling (not for DevTools),
the following approach had been chosen:

 - during snapshot creation, positions of serialized objects inside
   a snapshot are logged;

 - then during V8 initialization, positions of deserealized objects
   are logged;

 - those positions are used for retrieving code objects names from
   snapshot creation log, which needs to be supplied to tick processor
   script.

Positions logging is controlled with the new flag: --log_snapshot_positions.
This flag is turned off by default, and this adds no startup penalty.

To plug this fix to Golem, the following actions are needed:

 - logs created using 'mksnapshot' need to be stored along with VM images;

 - tick processor script needs to be run with '--snapshot-log=...' cmdline
   argument.

BUG=571

Review URL: http://codereview.chromium.org/551062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-18 16:04:25 +00:00
mikhail.naganov@gmail.com
e0b829b1a5 TickProcessor: more accurate mapping of statically compiled code on Linux.
'nm' is now called with an option to report function code sizes. Static code entries are restricted to the sizes reported, and the remaining unnamed code is attributed to a library as a whole. This makes reports more accurate, as some functions are tiny, but has chunks of unnamed code behind them.

This change doesn't affect reporting on Windows, as in .map files function code sizes aren't specified.

Review URL: http://codereview.chromium.org/149513


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2455 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-14 09:47:44 +00:00
mikhail.naganov@gmail.com
178a656429 Enhancing profiling data processing code with functionality needed for the Dev Tools Profiler.
Details:

 - added properties / functions in view objects needed for WebKit's ProfileView;

 - added ability to count profiles for specific functions.

The tickprocessor functionality does not affected.

Review URL: http://codereview.chromium.org/99181

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1823 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-30 08:10:27 +00:00
mikhail.naganov@gmail.com
aa2c33126c TickProcessor script reimplemented in JavaScript.
This is an effort to reuse profiler data processing code both in
TickProcessor and Dev Tools Profiler. The old Python implementation
will be removed.

The new TickProcessor works almost identical to the previous one.
However, it has some differences:

1. Not very useful "Call profile" section is replaced with a new
   WebKit-like "Bottom up (heavy) profile" which shows the most
   expensive functions together with their callers. I used it
   personally in order to find and remove bottlenecks in the
   tickprocessor script itself, and found it quite helpful.

2. Code entries with duplicate names (they occur for RegExes, stubs
   and sometimes for anonymous Function objects) are now distinguished
   by adding an occurence number inside curly brackets.

3. (Address -> code entry) mapping is more precise in boundary cases.

4. Windows version no more requires specifying .map file location.

5. Works faster.

Review URL: http://codereview.chromium.org/99054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1802 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-27 13:50:42 +00:00
mikhail.naganov@gmail.com
2060dc1512 Added ProfileView object for performing sorting, searching and filtering operations on a profile.
It will be used both in the new tickprocessor and Dev Tools profiler.

Review URL: http://codereview.chromium.org/92120

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1786 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-24 11:37:38 +00:00
mikhail.naganov@gmail.com
dfe8af02a6 Implemented Profile object that processes profiling events and calculates profiling data.
Review URL: http://codereview.chromium.org/77014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1739 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-17 17:40:52 +00:00