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

Issue 113762: Implement resource-saving mode of Profiler. (Closed)

Created:
11 years, 7 months ago by Mikhail Naganov
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Implement resource-saving ("lazy") mode of Profiler. This is intended to be used with Chromium. When in resource-saving mode, profiler doesn't consume any resources (sampler and logging is off) until resumed. Then again, when profiler is paused, sampling and logging are turned off. Tested under Linux and Windows. Also have done preliminary testing with Chromium. Committed: http://code.google.com/p/v8/source/detail?r=2036

Patch Set 1 #

Total comments: 4

Patch Set 2 : Removed "memory" from flag semantics, enhanced test. #

Patch Set 3 : Patch set 2 was screwed, this is the good one. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -20 lines) Patch
M src/flag-definitions.h View 1 1 chunk +3 lines, -0 lines 2 comments Download
M src/log.h View 2 chunks +5 lines, -0 lines 0 comments Download
M src/log.cc View 1 6 chunks +29 lines, -3 lines 2 comments Download
M src/platform.h View 1 chunk +3 lines, -2 lines 0 comments Download
M test/cctest/test-log.cc View 1 8 chunks +147 lines, -15 lines 2 comments Download

Messages

Total messages: 5 (0 generated)
Mikhail Naganov
11 years, 7 months ago (2009-05-22 09:10:34 UTC) #1
William Hesse
http://codereview.chromium.org/113762/diff/1/2 File src/flag-definitions.h (right): http://codereview.chromium.org/113762/diff/1/2#newcode340 Line 340: "Log profiling data to memory buffer, memory-saving mode" ...
11 years, 7 months ago (2009-05-22 11:10:04 UTC) #2
Mikhail Naganov
http://codereview.chromium.org/113762/diff/1/2 File src/flag-definitions.h (right): http://codereview.chromium.org/113762/diff/1/2#newcode340 Line 340: "Log profiling data to memory buffer, memory-saving mode" ...
11 years, 7 months ago (2009-05-22 11:53:10 UTC) #3
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/113762/diff/25/1005 File src/flag-definitions.h (right): http://codereview.chromium.org/113762/diff/25/1005#newcode338 Line 338: "Used with --prof, starts profiling automatically") Do ...
11 years, 7 months ago (2009-05-25 07:09:15 UTC) #4
Mikhail Naganov
11 years, 7 months ago (2009-05-25 08:23:43 UTC) #5
Thanks, Søren and William!

http://codereview.chromium.org/113762/diff/25/1005
File src/flag-definitions.h (right):

http://codereview.chromium.org/113762/diff/25/1005#newcode338
Line 338: "Used with --prof, starts profiling automatically")
On 2009/05/25 07:09:15, Søren Gjesse wrote:
> Do we need both --prof-auto and --prof-lazy. With your last change where
logging
> can be initiated by getting all the functions in the heap I don't see a reason
> for logging and sampling if not really profiling. Am I missing something here?
> If it makes sense to consolidate --prof-auto and --prof-lazy in some way you
can
> do that in a new change.

Currently, we have several differences in results of "traditional" compiler / gc
logging vs. heap traversal, the differences can be seen in the code of
"AreFuncNamesEqual" and "AreEntitiesEqual" functions from test-log.cc. They only
related to native and internal code, so they are irrelevant to web app
developers, but may make sense for V8 developers. That's why I'll prefer to
leave "traditional" profiling logging for some time until I figure out how to
handle this better.

http://codereview.chromium.org/113762/diff/25/1006
File src/log.cc (right):

http://codereview.chromium.org/113762/diff/25/1006#newcode181
Line 181: if (!FLAG_prof_lazy && !IsActive()) Start();
On 2009/05/25 07:09:15, Søren Gjesse wrote:
> I am not sure about this handling of the prof_lazy flag. The main reason for
> implementing the sliding window average was to enable some display of it in
> Chrome. This should be unrelated to dev tools - maybe in the task manager.
This
> is still not implemented, so I guess this is fine for now.

That's an important thing to know, thanks for noticing. I removed flag usage
from here, and also added checking of FLAG_sliding_state_window in
Pause/ResumeProfiler functions to avoid stopping/restarting Ticker when SSW is
enabled.

http://codereview.chromium.org/113762/diff/25/1009
File test/cctest/test-log.cc (right):

http://codereview.chromium.org/113762/diff/25/1009#newcode88
Line 88: template <typename T>
On 2009/05/25 07:09:15, Søren Gjesse wrote:
> Why is this a template function? T needs to be char for Logger::GetLogLines to
> match.

Yep, you're right. Fixed.

Powered by Google App Engine
This is Rietveld 408576698