Commit Graph

41 Commits

Author SHA1 Message Date
erik.corry@gmail.com
b3e0761e38 Cosmetic changes ("set up" is a verb, "setup" is a noun).
Review URL: http://codereview.chromium.org/9139051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10399 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-13 13:09:52 +00:00
mikhail.naganov@gmail.com
b706cfce94 Eliminate the need for code delete events in CPU profiler.
Events are still generated for tick processor on performance testing
server to work, as soon as scripts will be updated, it will be safe
to remove code delete events emitting code.

R=erik.corry@gmail.com
BUG=v8:1466
TEST=existing tests in test-profile-generator,test-cpu-profiler and mjsunit/tools

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-14 11:47:03 +00:00
sgjesse@chromium.org
8a6108de95 Remove the ability to compile without logging and profiling
The preprocessor defines ENABLE_LOGGING_AND_PROFILING and ENABLE_VMSTATE_TRACKING has been removed as these where required to be turned on for Crankshaft to work. To re-enable reducing the binary size by leaving out heap and CPU profiler a new set of defines needs to be created.

R=ager@chromium.org

BUG=v8:1271
TEST=all

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-13 09:09:04 +00:00
mikhail.naganov@gmail.com
650df48c55 Cleanup extra initialization of TickSample fields.
R=vitalyr@chromium.org
BUG=1293

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8368 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-22 13:54:35 +00:00
mikhail.naganov@gmail.com
508b22c436 "Deiceolate" Thread classes.
Thread class was receiving an isolate parameter by default.
This approact violates the assumption that only VM threads
can have an associated isolate, and can lead to troubles,
because accessing the same isolate from different threads
leads to race conditions.

This was found by investigating mysterious failures of the
CPU profiler layout test on Linux Chromium. As almost all
threads were associated with some isolate, the sampler was
trying to sample them.

As a side effect, we have also fixed the DebuggerAgent test.

Thanks to Vitaly for help in fixing isolates handling!

R=vitalyr@chromium.org
BUG=none
TEST=none

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:54:04 +00:00
mikhail.naganov@gmail.com
47248cc5fe Revert accidental r8254..r8256
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8257 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:42:08 +00:00
mikhail.naganov@gmail.com
f05fd92994 remove isolate reference from threads
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8254 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:35:31 +00:00
mikhail.naganov@gmail.com
dd2c990178 Remove redundant 'running' checks for ProfilerEventsProcessor in tests.
A follow up to r7949

R=vitalyr@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7969 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-20 15:11:00 +00:00
svenpanne@chromium.org
5cd715cbc3 A tiny contribution for the IWYU day: Include allocation.h in every
header which uses BASE_EMBEDDED and/or AllStatic. Note that still only
45 out of 135 headers in src/ can be used stand-alone, but at least
this is a little bit more than before...
Review URL: http://codereview.chromium.org/6931031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7798 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-06 06:50:20 +00:00
vitalyr@chromium.org
bde82b06c0 Avoid hidden TLS access in CpuProfiler::is_profiling().
Review URL: http://codereview.chromium.org/6895014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7677 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-22 06:40:22 +00:00
mikhail.naganov@gmail.com
b2b5d2777e Add support for CPU and heap profiles deletion.
R=vitalyr@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-22 16:10:01 +00:00
mikhail.naganov@gmail.com
d98baf8098 Fix DevTools CPU profiler after isolates merge.
There was an obvious bug with missing call to SamplerRegistry::GetState.
I've also updated CpuProfiler to avoid stopping sampler, if it didn't started it.

R=vitalyr@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-21 17:40:40 +00:00
vitalyr@chromium.org
7976ca2cbc Merge isolates to bleeding_edge.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 20:35:07 +00:00
vitalyr@chromium.org
76e226f832 Revert r7268: it borked the history.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 19:41:05 +00:00
vitalyr@chromium.org
6ff7fdebd3 Merge isolates to bleeding_edge.
Review URL: http://codereview.chromium.org/6685088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 18:49:56 +00:00
mikhail.naganov@gmail.com
943e4f8340 Remove `sfi' abbreviations (a follow-up to r6902).
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7124 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 12:00:27 +00:00
mikhail.naganov@gmail.com
6eb8c9e5a0 Revert r7119..r7121
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7123 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 11:55:03 +00:00
mikhail.naganov@gmail.com
47a5723704 comment
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7120 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 11:49:07 +00:00
mikhail.naganov@gmail.com
c6d2bb18aa renamed
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7119 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 11:48:56 +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
kasperl@chromium.org
90b3370374 Update V8 to version 3.0 (re-land r5920).
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:31:57 +00:00
kasperl@chromium.org
51b494d096 Revert r5920. Will re-land shortly.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:01:02 +00:00
kasperl@chromium.org
e5860bd6a8 Update V8 to version 3.0.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 09:11:56 +00:00
mikhail.naganov@gmail.com
5feede6667 CPU Profiler: postpone moved functions registration until GC completes.
An attempt to retrieve security context for a function may fail if the
destination heap space is in an incomplete state. To fix this, we only
record unknown functions discovered at GC object moves, and then
register them after GC completes.

BUG=crbug/59627

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5667 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-20 08:32:24 +00:00
vitalyr@chromium.org
e6b33bd20b Support profiling based on linux kernel performance events.
Since 2.6.31 perf_events interface has been available in the
kernel. There's a nice tool called "perf" (linux-2.6/tools/perf) that
uses this interface and provides capabilities similar to oprofile. The
simplest form of its usage is just dumping the raw log (trace) of
events generated by the kernel. In this patch I'm adding a script
(tools/ll_prof.py) to build profiles based on perf trace and our code
log. All the heavy-lifting is done by perf. Compared to oprofile agent
this approach does not require recompilation and supports code moving
garbage collections.

Expected usage is documented in the ll_prof's help. Basically one
should run V8 under perf passing --ll-prof flag and then the produced
logs can be analyzed by tools/ll_prof.py.

The new --ll-prof flag enables logging of generated code object
locations and names (like --log-code), and also of their bodies, which
can be later disassembled and annotated by the script.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5663 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-19 16:45:11 +00:00
mikhail.naganov@gmail.com
8f22667805 Provide more functions to CPU profiler (fix issue 858).
The cause for missing functions is that some of them are created
from compiled code (see FastNewClosureStub), and thus not get
registered in profiler's code map.

My solution is to hook on GC visitor to provide JS functions
addresses to profiler, only if it is enabled.

BUG=858
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5523 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-24 11:45:12 +00:00
mikhail.naganov@gmail.com
4bbf058d53 Fix CPU profiler crash in start / stop sequence when non-existent name is passed
BUG=51594
TEST=test-cpu-profiler/CrashIfStoppingLastNonExistentProfile

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5230 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-10 12:06:42 +00:00
mikhail.naganov@gmail.com
cdc09c5073 CPU profiler: sample call stack on profiling start.
This simplifies writing tests a lot, because it is now possible
to guarantee that certain function will present in a profile by
starting profiler from inside it.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4769 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-01 13:52:49 +00:00
mikhail.naganov@gmail.com
decd0fed78 CPU profiler: make code events handling scalable.
I changed the implementation of a queue between the VM and processor
thread to be unbounded and lock-free, using Herb Sutter's example from
DDJ article: http://www.ddj.com/high-performance-computing/210604448
This had brought back profiling overhead to a minimum for the page
from Chromium's issue 16184.

BUG=714

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4706 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-22 05:27:19 +00:00
mikhail.naganov@gmail.com
3d7ce8ac19 CPU profiler: add secure profiles by filtering out functions using security tokens.
As several pages can run in a single V8 instance, it is possible to
have functions from different security contexts intermixed in a single
CPU profile.  To avoid exposing function names from one page to
another, filtering is introduced.

The basic idea is that instead of capturing return addresses from
stack, we're now capturing JSFunction addresses (as we anyway work
only with JS stack frames.)  Each JSFunction can reach out for
context's security token. When providing a profile to a page, the
profile is filtered using the security token of caller page. Any
functions with different security tokens are filtered out (yes, we
only do fast path check for now) and their ticks are attributed to
their parents.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-18 14:19:33 +00:00
mikhail.naganov@gmail.com
c007fd4d15 merged
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-14 18:48:05 +00:00
mikhail.naganov@gmail.com
6f3f2f1c42 Allow new CPU profiling subsystem to coexist nicely with the old one.
This is to make possible enabling usage of the new profiling subsystem
in Chromium without much hassle. The idea is pretty simple: unless the
new profiling API is used, all works as usual, as soon as Chromium
starts to use the new API, it will work too.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4382 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-12 07:23:43 +00:00
mikhail.naganov@gmail.com
4f5ff869d3 C++ profiles processor: align browser mode with the old implementation, sample VM state.
In browser (DevTools) mode, only non-native JS code and callbacks are reported.
Also, added "(garbage collector)" entry which accumulates samples count in GC state.
Trying to display "(compiler)" and "(external)" only brings confusion,
because it ends up in displaying scripts code under "(compiler)" node, and DOM
event handlers under "(external)" node, which looks weird.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4357 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-07 14:18:26 +00:00
mikhail.naganov@gmail.com
393aa6865b C++ profiler: publish the new API, make compatible with WebKit / Chromium.
I succeeded at connecting the new implementation to Chromium, this
commit includes required (although, not all) adjustments.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4349 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-06 14:54:20 +00:00
mikhail.naganov@gmail.com
889f6cce74 C++ profiles processor: wire up to VM.
If 'shell' is compiled with 'cppprofilesprocessor=on' and run
with '--prof' flag, top-down and bottom-up call trees are printed
on shell exit.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4343 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-06 10:36:38 +00:00
mikhail.naganov@gmail.com
dde48831be C++ profiles processor: put under #ifdef and fix issues.
Review URL: http://codereview.chromium.org/1514006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4317 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-30 11:38:39 +00:00
mikhail.naganov@gmail.com
71754ebe81 Add multithreading test for SamplingCircularQueue, fix implementation.
This is for the case of Linux, where sampling is done using SIGPROF
signal handler which is executed in the context of an interrupted
thread. In this case, my previous implementation with TLS doesn't
work.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4207 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-22 14:23:45 +00:00
mikhail.naganov@gmail.com
89b040894e Add a few tests to ProfilerEventsProcessor.
Review URL: http://codereview.chromium.org/1084009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4197 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-19 13:51:01 +00:00
mikhail.naganov@gmail.com
cc43970611 Really fix ARM build (this time verified locally.)
TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4196 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-19 13:49:28 +00:00
mikhail.naganov@gmail.com
f7ba38332b Fix ARM build (GCC 3 'all member functions in class are private' warning.)
TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4195 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-19 13:07:43 +00:00
mikhail.naganov@gmail.com
9582645a02 Add basic C++ implementation of CPU profiler.
Review URL: http://codereview.chromium.org/1079006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-19 09:46:53 +00:00