Commit Graph

111 Commits

Author SHA1 Message Date
thakis
1f7a7b32d7 Fix C++ violation.
gcc rejects the following snippet, clang rejects it in -std=c++11 mode:
  namespace A { template<class T> class C {}; }
  namespace B { template class A::C<int>; }

Indeed, the C++ standard says in 14.7.2p2 "An explicit instantiation shall
appear in an enclosing namespace of its template", so cl.exe is incorrect to
allow this.

Just move the instantiation out of the v8 namespace to fix.  No intended
behavior change.  Fixes building with clang-cl on Windows.

BUG=chromium:475643
LOG=N
TBR=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27721}
2015-04-09 21:22:50 +00:00
loislo
eb95406e2b CpuProfiler: public API for deopt info in cpu profiler.
BUG=chromium:452067
LOG=n

Committed: https://crrev.com/baf927ff5115ec62a6dad684b9232ed9d3960e3a
Cr-Commit-Position: refs/heads/master@{#27626}

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

Cr-Commit-Position: refs/heads/master@{#27674}
2015-04-08 16:13:31 +00:00
machenbach
74dc9e1710 Revert of CpuProfiler: public API for deopt info in cpu profiler. (patchset #6 id:150001 of https://codereview.chromium.org/1045753002/)
Reason for revert:
[Sheriff] Breaks compile here:
http://build.chromium.org/p/client.v8/builders/V8%20Win32%20-%20nosnap%20-%20shared/builds/6115

Original issue's description:
> CpuProfiler: public API for deopt info in cpu profiler.
>
> BUG=chromium:452067
> LOG=n
>
> Committed: https://crrev.com/baf927ff5115ec62a6dad684b9232ed9d3960e3a
> Cr-Commit-Position: refs/heads/master@{#27626}

TBR=alph@chromium.org,jkummerow@chromium.org,svenpanne@chromium.org,yurys@chromium.org,loislo@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:452067

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

Cr-Commit-Position: refs/heads/master@{#27628}
2015-04-07 13:31:00 +00:00
loislo
baf927ff51 CpuProfiler: public API for deopt info in cpu profiler.
BUG=chromium:452067
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#27626}
2015-04-07 12:40:47 +00:00
yurys
f13d04d28c Return timestamp of the last recorded interval to the caller of HeapProfiler::GetHeapStats
Before this patch the embedder could assign timestamp to the last interval after calling GetHeapStats. This would be slightly different from the timstamps assigned by v8 internally and written into heap snapshot. This patch allow to avoid this small discrepancy by returning timestamp along with last heap stats update.

BUG=chromium:467222
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27466}
2015-03-26 08:50:02 +00:00
yurys
f92c8a3670 Remove obsolete TakeHeapSnapshot method from API
BUG=chromium:465651
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27208}
2015-03-16 09:49:28 +00:00
yurys
619d4535cc Remove uid and title from HeapSnapshot
None of these fields is used in Blink. Embedder always can implement them using existing API.

BUG=chromium:465651
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27113}
2015-03-10 15:14:07 +00:00
yurys
39d329103f Remove deprecated CpuProfiler methods
BUG=None
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#27097}
2015-03-10 11:58:24 +00:00
Benedikt Meurer
883852293a Revert "Make GCC happy again." and "Initial switch to Chromium-style CHECK_* and DCHECK_* macros.".
This reverts commit 6a4c0a3bae and commit
0deaa4b629 for breaking GCC bots.

TBR=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26342}
2015-01-30 07:19:57 +00:00
bmeurer
0deaa4b629 Initial switch to Chromium-style CHECK_* and DCHECK_* macros.
R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26340}
2015-01-30 06:25:36 +00:00
svenpanne@chromium.org
d56a21ebff The idea behind of this solution is to use the existing "relocation info" instead of consumption the CodeLinePosition events emitted by the V8 compilers.
During generation code and relocation info are generated simultaneously.
When code generation is done you each code object has associated "relocation info".
Relocation information lets V8 to mark interesting places in the generated code: the pointers that might need to be relocated (after garbage collection),
correspondences between the machine program counter and source locations for stack walking.

This patch:
1. Add more source positions info in reloc info to make it suitable for source level mapping.
The amount of data should not be increased dramatically because (1) V8 already marks interesting places in the generated code and
(2) V8 does not write redundant information (it writes a pair (pc_offset, pos) only if pos is changed and skips other).
I measured it on Octane benchmark - for unoptimized code the number of source positions may achieve 2x ('lin_solve' from NavierStokes benchmark).

2. When a sample happens, CPU profiler finds a code object by pc, then use its reloc info to match the sample to a source line.
If a source line is found that hit counter is increased by one for this line.

3. Add a new public V8 API to get the hit source lines by CDT CPU profiler.
Note that it's expected a minor patch in Blink to pack the source level info in JSON to be shown.

4.Add a test that checks how the samples are distributed through source lines.
It tests two cases: (1) relocation info created during code generation and (2) relocation info associated with precompiled function's version.

Patch from Denis Pravdin <denis.pravdin@intel.com>;

R=svenpanne@chromium.org, yurys@chromium.org

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

Patch from Weiliang <weiliang.lin@intel.com>.

Cr-Commit-Position: refs/heads/master@{#25182}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25182 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-06 09:17:14 +00:00
yurys@chromium.org
08c40baa1f Revert of Extend CPU profiler with mapping ticks to source lines (patchset #3 id:40001 of https://codereview.chromium.org/616963005/)
Reason for revert:
It broke layout test fast/events/window-onerror-02.html, error column reported by window.onerror is now wrong (I believe it is because of the change in full-codegen):

http://build.chromium.org/p/client.v8/builders/V8-Blink%20Linux%2064%20%28dbg%29/builds/652

Original issue's description:
> Extend CPU profiler with mapping ticks to source lines
>
> The idea behind of this solution is to use the existing "relocation info" instead of consumption the CodeLinePosition events emitted by the V8 compilers.
> During generation code and relocation info are generated simultaneously.
> When code generation is done you each code object has associated "relocation info".
> Relocation information lets V8 to mark interesting places in the generated code: the pointers that might need to be relocated (after garbage collection),
> correspondences between the machine program counter and source locations for stack walking.
>
> This patch:
> 1. Add more source positions info in reloc info to make it suitable for source level mapping.
> The amount of data should not be increased dramatically because (1) V8 already marks interesting places in the generated code and
> (2) V8 does not write redundant information (it writes a pair (pc_offset, pos) only if pos is changed and skips other).
> I measured it on Octane benchmark - for unoptimized code the number of source positions may achieve 2x ('lin_solve' from NavierStokes benchmark).
>
> 2. When a sample happens, CPU profiler finds a code object by pc, then use its reloc info to match the sample to a source line.
> If a source line is found that hit counter is increased by one for this line.
>
> 3. Add a new public V8 API to get the hit source lines by CDT CPU profiler.
> Note that it's expected a minor patch in Blink to pack the source level info in JSON to be shown.
>
> 4.Add a test that checks how the samples are distributed through source lines.
> It tests two cases: (1) relocation info created during code generation and (2) relocation info associated with precompiled function's version.
>
> Patch from Denis Pravdin <denis.pravdin@intel.com>
> BUG=None
> LOG=Y
> R=svenpanne@chromium.org
>
> Committed: https://code.google.com/p/v8/source/detail?r=24389

TBR=svenpanne@chromium.org,danno@chromium.org,alph@chromium.org,denis.pravdin@intel.com,weiliang.lin@intel.com
BUG=None
LOG=N

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24394 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-02 11:58:21 +00:00
yurys@chromium.org
6482fb3ee4 Extend CPU profiler with mapping ticks to source lines
The idea behind of this solution is to use the existing "relocation info" instead of consumption the CodeLinePosition events emitted by the V8 compilers.
During generation code and relocation info are generated simultaneously.
When code generation is done you each code object has associated "relocation info".
Relocation information lets V8 to mark interesting places in the generated code: the pointers that might need to be relocated (after garbage collection),
correspondences between the machine program counter and source locations for stack walking.

This patch:
1. Add more source positions info in reloc info to make it suitable for source level mapping.
The amount of data should not be increased dramatically because (1) V8 already marks interesting places in the generated code and
(2) V8 does not write redundant information (it writes a pair (pc_offset, pos) only if pos is changed and skips other).
I measured it on Octane benchmark - for unoptimized code the number of source positions may achieve 2x ('lin_solve' from NavierStokes benchmark).

2. When a sample happens, CPU profiler finds a code object by pc, then use its reloc info to match the sample to a source line.
If a source line is found that hit counter is increased by one for this line.

3. Add a new public V8 API to get the hit source lines by CDT CPU profiler.
Note that it's expected a minor patch in Blink to pack the source level info in JSON to be shown.

4.Add a test that checks how the samples are distributed through source lines.
It tests two cases: (1) relocation info created during code generation and (2) relocation info associated with precompiled function's version.

Patch from Denis Pravdin <denis.pravdin@intel.com>
BUG=None
LOG=Y
R=svenpanne@chromium.org

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

Patch from Denis Pravdin <denis.pravdin@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-02 09:20:37 +00:00
yurys@chromium.org
8751323701 Add support for ES6 Symbol in heap profiler
Heap profiler will create a node with name Symbol and type kSymbol.

BUG=chromium:376194
LOG=Y
R=loislo@chromium.org, yangguo@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21433 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-05-22 11:26:48 +00:00
ishell@chromium.org
ff2d004f85 Presubmit checks recover:
1) runtime/references checks temporarily disabled (56 items left)
2) other errors fixed

R=jkummerow@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21222 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-05-09 12:59:24 +00:00
bmeurer@chromium.org
d4b533d41b Bulk update of Google copyright headers in source files.
R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21035 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-29 06:42:26 +00:00
alph@chromium.org
a9655b7d37 Add timestamps to CPU profile samples.
BUG=363976
LOG=Y
R=bmeurer@chromium.org, yurys@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20993 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-25 18:53:06 +00:00
alph@chromium.org
b97a2a2585 Switch CPU profile start/stop markers to monotonic time.
LOG=N
BUG=363976
R=bmeurer@chromium.org, yurys@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-19 14:33:18 +00:00
yurys@chromium.org
f7b437d086 Deprecate Start/StopCpuProfiling methods
BUG=v8:3213
LOG=Y
R=alph@chromium.org, svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-28 09:24:49 +00:00
yurys@chromium.org
386063bf9e Fix compile error after r19955
BUG=None
TBR=svenpanne@chromium.org
LOG=N

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19956 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-17 07:09:49 +00:00
yurys@chromium.org
587b54482f Move profiler callback interfaces from v8.h to v8-profiler.h
OutputStream and ActivityControl are used only by heap profiler so I moved their definition in v8-profiler.h to not clutter v8.h

Drive-by: removed OutputStream::GetOutputEncoding which is unused.

BUG=None
LOG=Y
R=alph@chromium.org, svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19955 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-17 07:02:39 +00:00
yurys@chromium.org
0a61b7c996 StopCpuProfiling should return non-const CpuProfile
StopCpuProfiling is replaced with StopProfiling which returns non-const CpuProfile which allows to call CpuProfile::Delete on it without const_cast. Also replaced StartCpuProfiling with StartProfiling to have symmetric names for start/stop actions.

BUG=v8:3213
LOG=Y
R=alph@chromium.org, svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-03-14 09:26:31 +00:00
alph@chromium.org
1bace575f0 Allow self_size to be larger than 2GB in heap snapshots.
LOG=N
R=dslomov@chromium.org, yurys@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19445 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-18 13:22:07 +00:00
yurys@chromium.org
18e865d4fa Delete v8::HeapGraphNode::GetHeapValue
BUG=chromium:324769
LOG=N
R=hpayer@chromium.org, mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-23 09:33:16 +00:00
yurys@chromium.org
19b6b7ada8 Delete several deprecated methods on v8::CpuProfiler
All methods for accessing collected profiles by index are deprecated. The indexed storage may well be implemented by the embedder should he need it. CpuProfiler's responsibility is just to create CpuProfile object that contains all collected data and whose lifetime can be managed by the embedder.

BUG=chromium:327298
LOG=Y
R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18337 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-18 08:59:09 +00:00
yurys@chromium.org
8b542494c3 Add methods for finding object by its snapshot id and id for an object
Object<-->id mapping doesn't depend on a particular snapshot, actually same object may appear in several heap snapshots. The API for converting between id and heap object should be provided by HeapProfiler itself. There is already GetObjectId method which I extended with FindObjectById/ClearObjectIds. As the next step I'm going to deprecate and remove HeapGraphNode::GetHeapValue.

BUG=chromium:324769
LOG=N
R=alph@chromium.org, hpayer@chromium.org, mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18334 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-18 08:17:03 +00:00
svenpanne@chromium.org
402139f686 Remove all stuff marked as V8_DEPRECATED.
R=jochen@chromium.org, mstarzinger@chromium.org, yurys@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18333 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-18 08:09:37 +00:00
yurys@chromium.org
19f29c380e Do not stop profiling if all finished profiles were deleted
Deleting finished profiles shouldn't interrupt profile recording.

BUG=chromium:327298
LOG=N
R=alph@chromium.org, jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18302 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-11 14:39:18 +00:00
yurys@chromium.org
e87fe7b71f Simplify allocation tracker API
Deprecated separate methods for starting/stopping allocation tracking in favor of a bool param to Start/StopTrackingHeapObjects.

BUG=None
LOG=N
R=loislo@chromium.org, mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18197 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-12-02 14:27:24 +00:00
yurys@chromium.org
15db1d7c3a Track JS allocations as they arrive with no affection on performance when tracking is switched off.
BUG=277984
R=hpayer@chromium.org

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

Patch from Alexandra Mikhaylova <amikhaylova@google.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17191 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-14 12:41:28 +00:00
yurys@chromium.org
344d836d0f Add column getter to CpuProfileNode
CpuProfileNode currently exposes only line number which is not enough for the cases when there is more than one function on the same line. This change exposes column number on CpuProfileNode.

BUG=302537
R=jkummerow@chromium.org, loislo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17142 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-10-10 13:15:47 +00:00
dcarney@chromium.org
6dd72b6416 change of V8_DEPRECATED to be enabled behind a gyp flag
also add a deprecation message for newer gcc versions

R=danno@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17006 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-30 13:28:23 +00:00
loislo@chromium.org
f6b7ec4da0 HeapProfiler: very slow ~4min "take snapshot time" for 80MB gmail heap.
The reason of that is a number of cons strings in the app.
The app constructs a json string and as a result v8 heap has
a very long chain of cons strings.

Profiler counts all these strings as plain String objects and
assign the content of the strings as node names.

It required O(n^2) time and O(n^2) memory.

Solution: I introduced two new types, kConsString and kSliced string.
They do not use the content of the string for names. So the problem disappeared.

The heap profiler usability problem will be solved on Blink side.

BUG=285770
R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16611 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-10 11:12:35 +00:00
loislo@chromium.org
bbd26abedb Functions may not be optimized and we would like to know in cpu profiler what was the reason.
Current v8 implementation may disable optimization for a particular function or block it with help of dont_optimize flag.
The patch propagates the reason of that to the SharedFunctionInfo where cpu profiler can get it.

SharedFunctionInfo is a heap object so I extracted 8 bits from OptsCount for handling bailout reason code.

BUG=none
TEST=test-profile-generator/BailoutReason
R=yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16555 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-05 13:20:51 +00:00
yurys@chromium.org
c034bb48b5 Allow configuring CPU profiler sampling interval using public API
The only way to change it at the moment is using a command line flag. We are going to add a setting to Chrome DevTools which would allow chaning default interval and that requires proper v8 API.

BUG=v8:2814
R=bmeurer@chromium.org, loislo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16525 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-09-04 11:55:28 +00:00
yurys@chromium.org
dc670f4412 Remove implementation of CpuProfileNode methods deprecated in v8 3.20
GetTotalTime, GetSelfTime and GetTotalSamplesCount were deprecated in 3.20 (https://code.google.com/p/v8/source/browse/branches/3.20/include/v8-profiler.h) and can be safely removed.

BUG=None
R=bmeurer@chromium.org, loislo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16367 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-27 15:12:04 +00:00
yurys@chromium.org
1a6dd16270 Deprecate CpuProfileNode::GetSelfSamplesCount
This method is being replaced by GetHitCount.

BUG=267595
R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16312 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-26 08:10:10 +00:00
yurys@chromium.org
85d8178d87 Deprecate self and total time getters and total sample count getter on CpuProfileNode
All of these values are derived from the self samples count and there is no need to evaluate them in v8 when clients can do that when needed on their side.

Also added unsigned GetHitCount() which should be used instead of double GetSelfSamplesCount(). I'm going to deprecate the latter one once Blink has switched to GetHitCount.

BUG=267595
TBR=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16119 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-09 07:38:26 +00:00
yurys@chromium.org
4f56107e2f Revert "Deprecate self and total time getters and total sample count getter on CpuProfileNode"
This reverts commit r16116 due to WebKit compilation breakage. Will reland it once Blink r155755 is rolled into Chromium.

TBR=svenpanne@chromium.org
BUG=None

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-08 14:43:44 +00:00
yurys@chromium.org
122327d1c6 Deprecate self and total time getters and total sample count getter on CpuProfileNode
All of these values are derived from the self samples count and there is no need to evaluate them in v8 when clients can do that when needed on their side.

Also added unsigned GetHitCount() which should be used instead of double GetSelfSamplesCount(). I'm going to deprecate the latter one once Blink has switched to GetHitCount.

BUG=267595
R=loislo@chromium.org, svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-08 13:39:57 +00:00
yurys@chromium.org
707fdd4c6a Support idle time in CPU profiler
This change provides an API for the embedder to tell CPU profiler if it is idle or busy with some task. This way we can discriminate between idle time and some native code execution.

BUG=268947
R=alph@chromium.org, yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16109 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-07 17:04:27 +00:00
yurys@chromium.org
2144dc2d0f Define V8EXPORT only in v8.h and use it in the other headers
V8EXPORT is defined in each header of V8 public API and the definitions already have some slight discrepancies. This CL makes all headers use the same definition in v8.h

BUG=None
R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16078 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-06 14:37:35 +00:00
yurys@chromium.org
e06343431a Return start/end profiling time in microseconds instead of milliseconds
The start and end time are now measured in microseconds and the type is int64_t.
This way it seems more natural as we are going to support submilisecond sampling
rate soon. Also it fixes cctest/test-cpu-profiler/ProfileStartEndTime test
failure caused by comparison between long double and double.

TEST=cctest/test-cpu-profiler/ProfileStartEndTime
BUG=v8:2824
R=bmeurer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-06 08:00:58 +00:00
bmeurer@chromium.org
274f254236 Revert "Return start/end profiling time in microseconds instead of milliseconds"
This reverts r16049 for breaking build on windows.

TBR=svenpanne@chromium.org,machenbach@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16050 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-05 12:27:12 +00:00
yurys@chromium.org
d38bbe354b Return start/end profiling time in microseconds instead of milliseconds
The start and end time are now measured in microseconds and the type is int64_t. This way it seems more natural as we are going to support submilisecond sampling rate soon. Also it fixes cctest/test-cpu-profiler/ProfileStartEndTime test failure caused by comparison between long double and double.

TEST=cctest/test-cpu-profiler/ProfileStartEndTime
BUG=v8:2824
R=alph@chromium.org, bmeurer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16049 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-05 11:48:24 +00:00
yurys@chromium.org
411d21b2b1 Add start and end profiling time to v8::CpuProfile
I'm going to change CPU profiler API and deprecate GetSelfTime, GetTotalTime and GetTotalSamplesCount on CpuProfileNode as all of those values are derived from self samples count and sampling rate. The sampling rate in turn is calculate based on the profiling duration so having start/end time and total sample count is enough for calculating smpling rate.

BUG=267595
R=alph@chromium.org, bmeurer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-08-05 07:17:08 +00:00
yurys@chromium.org
696090196d Delete deprecated CPU profiler code that supports filtering by security token
The methods that allow to filter CPU profile by security token were introduced to support console.profiles in WebKit. Now that console.profiles is removed and corresponding V8 API methods have been deprecated in 3.19 branch(https://code.google.com/p/v8/source/browse/branches/3.19/include/v8-profiler.h) it is safe to remove all that code.

BUG=None
R=jkummerow@chromium.org, loislo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-06 09:12:09 +00:00
yurys@chromium.org
44981e4f5e Remove deprecated heap profiler methods from V8 public API
v8::HeapProfiler::FindHeapSnapshot was already deprecated when 3.19 branch was created (https://code.google.com/p/v8/source/browse/branches/3.19/include/v8-profiler.h).

BUG=None
R=loislo@chromium.org, yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-04 16:34:07 +00:00
loislo@chromium.org
a0140093ba CPUProfiler: propagate scriptId to the front-end
Each CpuProfileNode has resource_name string property.
It cost us N * strlen(resource_name) where N is number of functions in the collected profile.
We could transfer script_id instead of resource_name so it would reduce transfer
size and help us to solve the problem with evals and sourceURL.

BUG=none
TEST=test-cpu-profiler/CollectCpuProfile
R=jkummerow@chromium.org, yurys@chromium.org

Committed: https://code.google.com/p/v8/source/detail?r=15429

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15433 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-02 06:14:01 +00:00
loislo@chromium.org
f470bbbb4f Revert "CPUProfiler: propagate scriptId to the front-end"
This reverts commit d575f6bc8b262dac08f02913ae6e7c504c9dd900.

Check is failing on debug bots.

TBR= yurys@chromium.org

Review URL: https://chromiumcodereview.appspot.com/18332010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15431 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-07-01 19:22:45 +00:00