I think it should be possible to use the profiler through the API without having
to worry about security contexts.

When a CPU profile where time spend in other security contexts are generated it
might make sense to have an indication of how much time is spend in the
different security contexts. Each node might have received time from "hidden"
functions in another security context, and it might make sense to provide
information that of the time in a given function XX% is attributed from a
different security context.

Also on the profile as a whole providing information on time spend in other
security contexts besides the one it is filtered for could be useful.


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

http://codereview.chromium.org/2083005/diff/1/2#newcode121
include/v8-profiler.h:121: class V8EXPORT CpuProfile {
Shouldn't it be possible to get a list of all the security contexts
encountered while collecting a profile?

http://codereview.chromium.org/2083005/diff/1/2#newcode140
include/v8-profiler.h:140: class V8EXPORT CpuProfiler {
Please add some comments about what the security_token argument is used
for and how it affects the results.

http://codereview.chromium.org/2083005/diff/1/2#newcode147
include/v8-profiler.h:147: static int GetProfilesCount(Handle<Value>
security_token);
Why not just use an empty handle as a default value to allow profiling
while ignoring security tokens and not break the API?

http://codereview.chromium.org/2083005/diff/1/2#newcode163
include/v8-profiler.h:163: static void StartProfiling(Handle<String>
title);
Also please explain why StartProfiling does not require a security_token
while StopProfiling does.

http://codereview.chromium.org/2083005/diff/1/9
File src/profile-generator.cc (right):

http://codereview.chromium.org/2083005/diff/1/9#newcode65
src/profile-generator.cc:65: GlobalHandles::MakeWeak(handle.location(),
this, TokenRemovedCallback);
As far as I can see the lists in the token enumerator will keep growing,
don't know whether that will cause problems (not sure about the lifetime
of a CpuProfiler), but maybe some reorganization on GC should be
considered.

http://codereview.chromium.org/2083005/diff/1/9#newcode377
src/profile-generator.cc:377: CpuProfile* clone = new CpuProfile(title_,
uid_);
Shouldn't the filtered clone have the information on its "original"
profile and the security token it has been filtered for?

http://codereview.chromium.org/2083005/diff/1/9#newcode566
src/profile-generator.cc:566: int
CpuProfilesCollection::TokenToPosition(int security_token_id) {
TokenToPosition -> TokenToIndex?

http://codereview.chromium.org/2083005/show

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to