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

Issue 1079006: Add basic C++ implementation of CPU profiler. (Closed)

Created:
10 years, 9 months ago by mnaganov (inactive)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Add basic C++ implementation of CPU profiler. Committed: http://code.google.com/p/v8/source/detail?r=4189

Patch Set 1 #

Patch Set 2 : Added copyrights for new files #

Total comments: 22

Patch Set 3 : Fixed lint and compilation errors. #

Total comments: 6

Patch Set 4 : Comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+864 lines, -157 lines) Patch
M src/SConscript View 1 chunk +1 line, -0 lines 0 comments Download
A src/cpu-profiler.h View 1 2 3 1 chunk +180 lines, -0 lines 0 comments Download
A src/cpu-profiler.cc View 1 2 3 1 chunk +201 lines, -0 lines 0 comments Download
A src/cpu-profiler-inl.h View 1 2 3 1 chunk +50 lines, -0 lines 0 comments Download
M src/frames.cc View 1 chunk +25 lines, -0 lines 0 comments Download
M src/handles.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/handles.cc View 1 chunk +24 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 26 chunks +52 lines, -22 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M src/platform.h View 1 chunk +1 line, -1 line 0 comments Download
M src/profile-generator.h View 4 chunks +65 lines, -52 lines 0 comments Download
M src/profile-generator.cc View 1 2 1 chunk +114 lines, -34 lines 0 comments Download
M src/profile-generator-inl.h View 2 chunks +11 lines, -18 lines 0 comments Download
M src/runtime.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M test/cctest/test-profile-generator.cc View 8 chunks +78 lines, -19 lines 0 comments Download
M tools/gyp/v8.gyp View 1 chunk +3 lines, -0 lines 0 comments Download
M tools/v8.xcodeproj/project.pbxproj View 5 chunks +10 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base.vcproj View 1 chunk +12 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base_arm.vcproj View 1 chunk +12 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base_x64.vcproj View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
mnaganov (inactive)
10 years, 9 months ago (2010-03-18 21:24:50 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/1079006/diff/3001/4002 File src/cpu-profiler-inl.h (right): http://codereview.chromium.org/1079006/diff/3001/4002#newcode43 src/cpu-profiler-inl.h:43: evt->order = enqueue_order_; // no increment! Uppercase n. ...
10 years, 9 months ago (2010-03-19 08:58:58 UTC) #2
mnaganov (inactive)
10 years, 9 months ago (2010-03-19 09:33:13 UTC) #3
Thank you very much!

http://codereview.chromium.org/1079006/diff/3001/4002
File src/cpu-profiler-inl.h (right):

http://codereview.chromium.org/1079006/diff/3001/4002#newcode43
src/cpu-profiler-inl.h:43: evt->order = enqueue_order_;  // no increment!
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Uppercase n.

Done.

http://codereview.chromium.org/1079006/diff/3001/4003
File src/cpu-profiler.cc (right):

http://codereview.chromium.org/1079006/diff/3001/4003#newcode54
src/cpu-profiler.cc:54: String* resource_name, int line_number,
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Long line please break.

Fixed in the next patch set.

http://codereview.chromium.org/1079006/diff/3001/4003#newcode69
src/cpu-profiler.cc:69: Address start, unsigned size) {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Please break line to have all arguments on separate lines when they cannot
fit.

Done.

http://codereview.chromium.org/1079006/diff/3001/4003#newcode83
src/cpu-profiler.cc:83: Address start, unsigned size) {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Ditto.

Done.

http://codereview.chromium.org/1079006/diff/3001/4003#newcode116
src/cpu-profiler.cc:116: void
ProfilerEventsProcessor::FunctionCreateEvent(Address alias, Address start) {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Long line.

Fixed in the next patch set.

http://codereview.chromium.org/1079006/diff/3001/4004
File src/cpu-profiler.h (right):

http://codereview.chromium.org/1079006/diff/3001/4004#newcode45
src/cpu-profiler.h:45: struct CodeEventRecord {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> struct -> class?

Done.

http://codereview.chromium.org/1079006/diff/3001/4004#newcode65
src/cpu-profiler.h:65: INLINE(void ModifyCodeMap(CodeMap* code_map)) {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> ModifyCodeMap -> UpdateCodeMap?

Renamed here and in below.

http://codereview.chromium.org/1079006/diff/3001/4004#newcode103
src/cpu-profiler.h:103: struct TickSampleEventRecord {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> struct -> class?

Done.

http://codereview.chromium.org/1079006/diff/3001/4004#newcode117
src/cpu-profiler.h:117: class ProfilerEventsProcessor : public Thread {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> I think you should add a comment about this class implements both the profile
> events processor thread and the methods called by the events producer, that is
> the public part of this class is called by the V8 code (is the V8 thread(s)).

Done.

http://codereview.chromium.org/1079006/diff/3001/4004#newcode124
src/cpu-profiler.h:124: 
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Comment that these methods are used to add events (from the V8 thread).

Done.

http://codereview.chromium.org/1079006/diff/3001/4004#newcode152
src/cpu-profiler.h:152: 
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Comment that these methods are used to process events pulled from the queues.

Done.

http://codereview.chromium.org/1079006/diff/5001/6002
File src/cpu-profiler-inl.h (right):

http://codereview.chromium.org/1079006/diff/5001/6002#newcode40
src/cpu-profiler-inl.h:40: TickSample*
ProfilerEventsProcessor::TickSampleEvent() {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Could you please make a comment here explaining how TickSampleEventRecords are
> stored directly in the circular buffer, and that this returns a pointer to the
> next free entry to write to.

Added a comment in the class definition (.h file.)

http://codereview.chromium.org/1079006/diff/5001/6003
File src/cpu-profiler.cc (right):

http://codereview.chromium.org/1079006/diff/5001/6003#newcode48
src/cpu-profiler.cc:48: enqueue_order_(0) {
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> {}'s on same line when body is empty?

Done.

http://codereview.chromium.org/1079006/diff/5001/6004
File src/cpu-profiler.h (right):

http://codereview.chromium.org/1079006/diff/5001/6004#newcode105
src/cpu-profiler.h:105: // SamplingCircularQueue::kClear, while sample.pc can't.
On 2010/03/19 08:58:59, Søren Gjesse wrote:
> Maybe elaborate a bit here showing how TickSample will be "expanded" into the
> TickSampleEventRecord.

Done.

Powered by Google App Engine
This is Rietveld 408576698