Revision: 17229
Author:   [email protected]
Date:     Wed Oct 16 08:15:06 2013 UTC
Log:      Fix unexpected stack traces in test-cpu-profiler/JsNativeJsSample

This is a follow-up fix for r17140 which makes sure that cpu profiler is started before profiled js functions are compiled so that the profiler gets information about "no frame" ranges along with add code events.

BUG=v8:2933
[email protected], [email protected]

Review URL: https://codereview.chromium.org/27121003
http://code.google.com/p/v8/source/detail?r=17229

Modified:
 /branches/bleeding_edge/test/cctest/cctest.status
 /branches/bleeding_edge/test/cctest/test-cpu-profiler.cc

=======================================
--- /branches/bleeding_edge/test/cctest/cctest.status Wed Oct 2 18:06:20 2013 UTC +++ /branches/bleeding_edge/test/cctest/cctest.status Wed Oct 16 08:15:06 2013 UTC
@@ -55,9 +55,6 @@

   # Boot up memory use is bloated in debug mode.
'test-mark-compact/BootUpMemoryUse': [PASS, PASS, ['mode == debug', FAIL]],
-
-  # Some CPU profiler tests are flaky.
-  'test-cpu-profiler/*': [PASS, FLAKY],
 }],  # ALWAYS

##############################################################################
=======================================
--- /branches/bleeding_edge/test/cctest/test-cpu-profiler.cc Thu Oct 10 13:15:47 2013 UTC +++ /branches/bleeding_edge/test/cctest/test-cpu-profiler.cc Wed Oct 16 08:15:06 2013 UTC
@@ -411,13 +411,11 @@
 static const v8::CpuProfile* RunProfiler(
     LocalContext& env, v8::Handle<v8::Function> function,
     v8::Handle<v8::Value> argv[], int argc,
-    unsigned min_js_samples, bool script_will_start_profiler = false) {
+    unsigned min_js_samples) {
   v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler();
   v8::Local<v8::String> profile_name = v8::String::New("my_profile");

-  if (!script_will_start_profiler) {
-    cpu_profiler->StartCpuProfiling(profile_name);
-  }
+  cpu_profiler->StartCpuProfiling(profile_name);

   i::Sampler* sampler =
reinterpret_cast<i::Isolate*>(env->GetIsolate())->logger()->sampler();
@@ -1144,7 +1142,7 @@
   int32_t duration_ms = 20;
   v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
   const v8::CpuProfile* profile =
-      RunProfiler(env, function, args, ARRAY_SIZE(args), 10, true);
+      RunProfiler(env, function, args, ARRAY_SIZE(args), 10);

   const v8::CpuProfileNode* root = profile->GetTopDownRoot();
   {
@@ -1223,7 +1221,7 @@
   int32_t duration_ms = 20;
   v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
   const v8::CpuProfile* profile =
-      RunProfiler(env, function, args, ARRAY_SIZE(args), 10, true);
+      RunProfiler(env, function, args, ARRAY_SIZE(args), 10);

   const v8::CpuProfileNode* root = profile->GetTopDownRoot();
   ScopedVector<v8::Handle<v8::String> > names(3);
@@ -1310,7 +1308,7 @@
   int32_t duration_ms = 20;
   v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) };
   const v8::CpuProfile* profile =
-      RunProfiler(env, function, args, ARRAY_SIZE(args), 10, true);
+      RunProfiler(env, function, args, ARRAY_SIZE(args), 10);

   const v8::CpuProfileNode* root = profile->GetTopDownRoot();
   ScopedVector<v8::Handle<v8::String> > names(3);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to