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

Issue 159581: Add generic V8 API functions for controlling profiling aspects. (Closed)

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

Description

Add generic V8 API functions for controlling profiling aspects. As we'll have several aspects of heap profiling, it is more handy to control them using binary flags than by individual functions. CPU profiling represent just a particular aspect to control, so {Pause,Resume}Profiler and IsProfilerPaused are only left for compatibility. For now, PROFILER_FLAG_HEAP_STATS and PROFILER_FLAG_JS_CONSTRUCTOR are equivalent, but later will be split. Committed: http://code.google.com/p/v8/source/detail?r=2574

Patch Set 1 #

Total comments: 10

Patch Set 2 : Renamings #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -0 lines) Patch
M include/v8.h View 1 2 chunks +40 lines, -0 lines 0 comments Download
M src/api.cc View 1 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mikhail Naganov
11 years, 4 months ago (2009-07-29 09:15:16 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/159581/diff/1/2 File include/v8.h (right): http://codereview.chromium.org/159581/diff/1/2#newcode1976 Line 1976: PROFILER_FLAG_EMPTY = 0, EMPTY -> NONE http://codereview.chromium.org/159581/diff/1/2#newcode2144 ...
11 years, 4 months ago (2009-07-29 09:30:20 UTC) #2
Mikhail Naganov
11 years, 4 months ago (2009-07-29 11:21:16 UTC) #3
OK, I've performed several renamings to make introduced function names more
consistent with existing ones.

http://codereview.chromium.org/159581/diff/1/2
File include/v8.h (right):

http://codereview.chromium.org/159581/diff/1/2#newcode1976
Line 1976: PROFILER_FLAG_EMPTY          = 0,
On 2009/07/29 09:30:20, Søren Gjesse wrote:
> EMPTY -> NONE

Done.

http://codereview.chromium.org/159581/diff/1/2#newcode2144
Line 2144: static void SetProfilerFlags(int flags);
On 2009/07/29 09:30:20, Søren Gjesse wrote:
> How about changing this to be called StartProfiling?

I think you're right in the sense that 'SetProfilerFlags' doesn't specifies that
V8 will start profiling, it looks more like setting up a configuration, and thus
confusing. But having two functions named similar: 'ResumeProfiling' and
'StartProfiling' is confusing too.

I decided to follow Win API tradition and call it ResumeProfilerEx.

http://codereview.chromium.org/159581/diff/1/2#newcode2154
Line 2154: static void ClearProfilerFlags(int flags);
On 2009/07/29 09:30:20, Søren Gjesse wrote:
> and this to StopProfiling?

PauseProfilerEx

http://codereview.chromium.org/159581/diff/1/2#newcode2161
Line 2161: static int GetProfilerFlags();
On 2009/07/29 09:30:20, Søren Gjesse wrote:
> and GetActiveProfiling/GetCurrentProfiling?

GetActiveProfilerModules. I also changed enum's name to ProfilerModules.

http://codereview.chromium.org/159581/diff/1/3
File src/api.cc (right):

http://codereview.chromium.org/159581/diff/1/3#newcode3244
Line 3244: i::FLAG_log_gc = true;
On 2009/07/29 09:30:20, Søren Gjesse wrote:
> Are you planning on somehow storing the current profiling flags inside the
> Logger and only use FLAG_log_gc (and FLAG_prof) to initialize it, instead of
> having FLAG_log_gc controlling the heap profiling?

Maybe somewhere inside 'heap' module. For now I want to introduce API functions
and make them work somehow, so I'm simply using the fact that currently
HeapProfiler class behavior is controlled with this flag.

Powered by Google App Engine
This is Rietveld 408576698