Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Issue 1694011: Adds C++ API for retrieving a stack trace without running JavaScript (Closed)

Created:
10 years, 8 months ago by jaimeyap
Modified:
9 years, 7 months ago
CC:
v8-dev, Kelly Norton
Visibility:
Public.

Description

Adds C++ API for retrieving a stack trace without invoking JavaScript. This is important for browser profiling since grabbing a stack trace via the API in messages.js and debug-debugger.js frequently allows GC to run. This API can still allow GC to run, but only rarely in situations where the heap allocator is unable to service an allocation request. This matters alot currently for the profiling infrastructure in InspectorTimelineAgent in WebCore, which is used by the WebKit inspector's timeline panel, and Google Speed Tracer. This API is extensible, and parameterized with flags so that callers can specify what subset of information they want to capture for each stack frame. Regarding duplication of code. The API in top.cc and messages.js is aimed mainly at string printing Stack frames, and not at exposing API for programatically reading information about the stack. Also, the API available in debug-debugger.js and mirror-debugger.js are aimed at mainly supporting the interactive debugging use case, and are actually quite slow. I think I could possible port some of the code in messages.js to use this new StackTrace API, but I would preferrably do that in a follow up patch.

Patch Set 1 #

Total comments: 3

Patch Set 2 : '' #

Total comments: 14

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 49

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 22

Patch Set 9 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+434 lines, -9 lines) Patch
M include/v8.h View 2 3 4 5 6 7 8 2 chunks +102 lines, -0 lines 0 comments Download
M include/v8-profiler.h View 1 chunk +1 line, -1 line 0 comments Download
M src/api.h View 2 3 4 5 6 4 chunks +12 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 3 4 5 6 4 chunks +115 lines, -3 lines 0 comments Download
M src/messages.js View 7 8 2 chunks +5 lines, -2 lines 0 comments Download
M src/top.h View 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M src/top.cc View 2 3 4 5 6 7 8 3 chunks +86 lines, -2 lines 0 comments Download
M test/cctest/test-api.cc View 4 5 6 1 chunk +109 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
jaimeyap
Requesting feedback. Will cover with appropriate test cases once consensus is reached on what the ...
10 years, 8 months ago (2010-04-22 18:17:54 UTC) #1
Søren Thygesen Gjesse
On 2010/04/22 18:17:54, jaimeyap wrote: > Requesting feedback. Will cover with appropriate test cases once ...
10 years, 8 months ago (2010-04-23 08:30:56 UTC) #2
mnaganov (inactive)
Jaime, what usage scenario are you targeting on? The function you wrote captures the current ...
10 years, 8 months ago (2010-04-23 08:33:49 UTC) #3
jaimeyap
On 2010/04/23 08:30:56, Søren Gjesse wrote: > On 2010/04/22 18:17:54, jaimeyap wrote: > > Requesting ...
10 years, 8 months ago (2010-04-23 15:17:17 UTC) #4
jaimeyap
On 2010/04/23 08:33:49, Michail Naganov wrote: > Jaime, what usage scenario are you targeting on? ...
10 years, 8 months ago (2010-04-23 15:28:58 UTC) #5
jaimeyap
Before nailing things down with unit tests, I just wanted you guys to take a ...
10 years, 7 months ago (2010-04-29 22:45:12 UTC) #6
mnaganov (inactive)
http://codereview.chromium.org/1694011/diff/9001/10002 File include/v8.h (right): http://codereview.chromium.org/1694011/diff/9001/10002#newcode772 include/v8.h:772: * This method will return 0 if it is ...
10 years, 7 months ago (2010-04-30 10:01:22 UTC) #7
jaimeyap
Patch updated according to Michail's comments. Working on unit tests now. http://codereview.chromium.org/1694011/diff/9001/10002 File include/v8.h (right): ...
10 years, 7 months ago (2010-04-30 17:43:41 UTC) #8
mnaganov (inactive)
http://codereview.chromium.org/1694011/diff/9001/10003 File src/top.cc (right): http://codereview.chromium.org/1694011/diff/9001/10003#newcode380 src/top.cc:380: Handle<JSArray> stackTrace = Factory::NewJSArray(frame_limit); On 2010/04/30 17:43:41, jaimeyap wrote: ...
10 years, 7 months ago (2010-04-30 21:29:19 UTC) #9
jaimeyap
Adding tests and fixing lint errors. http://codereview.chromium.org/1694011/diff/9001/10003 File src/top.cc (right): http://codereview.chromium.org/1694011/diff/9001/10003#newcode380 src/top.cc:380: Handle<JSArray> stackTrace = ...
10 years, 7 months ago (2010-05-01 21:17:42 UTC) #10
Søren Thygesen Gjesse
Please take a look at the stack traces used for stack traces in JavaScript exceptions ...
10 years, 7 months ago (2010-05-03 07:59:21 UTC) #11
jaimeyap
Thanks for the review. I will put up another patch set after we decide whether ...
10 years, 7 months ago (2010-05-03 19:16:02 UTC) #12
Søren Thygesen Gjesse
As mentioned in the comment there is no need to "pre-allocate" symbols for strings used ...
10 years, 7 months ago (2010-05-04 06:29:58 UTC) #13
mnaganov (inactive)
http://codereview.chromium.org/1694011/diff/35007/38002 File include/v8.h (right): http://codereview.chromium.org/1694011/diff/35007/38002#newcode808 include/v8.h:808: static const int kNotFound; On 2010/05/03 19:16:02, jaimeyap wrote: ...
10 years, 7 months ago (2010-05-04 09:59:17 UTC) #14
jaimeyap
Patch updated and ready for review. Sorry for uploading so many patches, it seems my ...
10 years, 7 months ago (2010-05-04 15:05:28 UTC) #15
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/1694011/diff/55001/56002 File include/v8.h (right): http://codereview.chromium.org/1694011/diff/55001/56002#newcode697 include/v8.h:697: static const int kNoLineNumberInfo = 0; Please remove ...
10 years, 7 months ago (2010-05-05 07:24:18 UTC) #16
jaimeyap
Thanks for the review. I will need a committer to land this for me. http://codereview.chromium.org/1694011/diff/55001/56002 ...
10 years, 7 months ago (2010-05-05 14:49:54 UTC) #17
Søren Thygesen Gjesse
Thanks for addressing the final comments. I will land the change.
10 years, 7 months ago (2010-05-05 16:01:25 UTC) #18
Søren Thygesen Gjesse
10 years, 7 months ago (2010-05-06 11:09:49 UTC) #19
On 2010/05/05 16:01:25, Søren Gjesse wrote:
> Thanks for addressing the final comments. I will land the change.

Landed through http://codereview.chromium.org/2028001,
http://code.google.com/p/v8/source/detail?r=4597.

Closing issue.

Powered by Google App Engine
This is Rietveld 408576698