From 5b105b248ee10ab196b423a4e55a3c645bf8ea71 Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Wed, 16 Oct 2013 08:15:06 +0000 Subject: [PATCH] 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 R=jkummerow@chromium.org, loislo@chromium.org Review URL: https://codereview.chromium.org/27121003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/cctest/cctest.status | 3 --- test/cctest/test-cpu-profiler.cc | 12 +++++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status index b5154a8498..fe42883fff 100644 --- a/test/cctest/cctest.status +++ b/test/cctest/cctest.status @@ -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 ############################################################################## diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc index db645e3af8..9ef307c6f4 100644 --- a/test/cctest/test-cpu-profiler.cc +++ b/test/cctest/test-cpu-profiler.cc @@ -411,13 +411,11 @@ TEST(ProfileStartEndTime) { static const v8::CpuProfile* RunProfiler( LocalContext& env, v8::Handle function, v8::Handle 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 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(env->GetIsolate())->logger()->sampler(); @@ -1144,7 +1142,7 @@ TEST(JsNativeJsSample) { int32_t duration_ms = 20; v8::Handle 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 @@ TEST(JsNativeJsRuntimeJsSample) { int32_t duration_ms = 20; v8::Handle 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 > names(3); @@ -1310,7 +1308,7 @@ TEST(JsNative1JsNative2JsSample) { int32_t duration_ms = 20; v8::Handle 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 > names(3);