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

Unified Diff: test/cctest/test-cpu-profiler.cc

Issue 2804593005: Revert of [profiler] reduce incorrectly unaccounted ticks. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-cpu-profiler.cc
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc
index 5cb40763ce540e655b34bb0adddad201f4b73011..08f262d0e78be9bbcd59c7f4e40247b7c3820462 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -619,51 +619,6 @@
arraysize(delay_branch));
profile->Delete();
-}
-
-static const char* cpu_profiler_toplevel_source =
- "for (var i = 0; i < 1E5; i++) {"
- " var s = 0;"
- " for (var j = 0; j < 1E2; j++) s += i;"
- "}";
-
-TEST(CollectOptimizedToplevelProfile) {
- LocalContext env;
- v8::HandleScope scope(env->GetIsolate());
-
- v8::CpuProfiler* profiler = v8::CpuProfiler::New(env->GetIsolate());
- v8::Local<v8::String> profile_name = v8_str("my_profile");
-
- profiler->SetSamplingInterval(100);
- profiler->StartProfiling(profile_name, true);
- v8::internal::CpuProfiler* iprofiler =
- reinterpret_cast<v8::internal::CpuProfiler*>(profiler);
- v8::sampler::Sampler* sampler = iprofiler->processor()->sampler();
- sampler->StartCountingSamples();
-
- CompileRun(cpu_profiler_toplevel_source);
-
- v8::CpuProfile* profile = profiler->StopProfiling(profile_name);
- reinterpret_cast<i::CpuProfile*>(profile)->Print();
-
- const v8::CpuProfileNode* root = profile->GetTopDownRoot();
- v8::Local<v8::String> empty = v8::String::Empty(env->GetIsolate());
- unsigned toplevel_hitcount = 0;
- unsigned unaccounted_hitcount = 0;
- for (int i = 0; i < root->GetChildrenCount(); i++) {
- const v8::CpuProfileNode* child = root->GetChild(i);
- if (empty->Equals(env.local(), child->GetFunctionName()).FromJust()) {
- toplevel_hitcount += child->GetHitCount();
- } else {
- unaccounted_hitcount += child->GetHitCount();
- }
- }
- // Check that we are getting more ticks from the toplevel function than
- // unaccounted ticks.
- DCHECK(toplevel_hitcount > unaccounted_hitcount);
-
- profile->Delete();
- profiler->Dispose();
}
static const char* hot_deopt_no_frame_entry_test_source =
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698