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

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

Issue 7046001: Fix bug with long stack traces truncation in DevTools CPU profiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 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 | « src/cpu-profiler.cc ('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 749ac154340bda2e4ec91e86158e5cb212614d90..17611acbf91409a796146dca528c85cf23d53da2 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -238,6 +238,49 @@ TEST(CrashIfStoppingLastNonExistentProfile) {
}
+// http://code.google.com/p/v8/issues/detail?id=1398
+// Long stacks (exceeding max frames limit) must not be erased.
+TEST(Issue1398) {
+ TestSetup test_setup;
+ CpuProfilesCollection profiles;
+ profiles.StartProfiling("", 1);
+ ProfileGenerator generator(&profiles);
+ ProfilerEventsProcessor processor(i::Isolate::Current(), &generator);
+ processor.Start();
+ while (!processor.running()) {
Vitaly Repeshko 2011/05/19 11:31:01 ProfilerEventsProcessor sets "running" to true in
+ i::Thread::YieldCPU();
+ }
+
+ processor.CodeCreateEvent(i::Logger::BUILTIN_TAG,
+ "bbb",
+ ToAddress(0x1200),
+ 0x80);
+
+ i::TickSample* sample = processor.TickSampleEvent();
+ sample->pc = ToAddress(0x1200);
+ sample->tos = 0;
+ sample->frames_count = i::TickSample::kMaxFramesCount;
+ for (int i = 0; i < sample->frames_count; ++i) {
+ sample->stack[i] = ToAddress(0x1200);
+ }
+
+ processor.Stop();
+ processor.Join();
+ CpuProfile* profile =
+ profiles.StopProfiling(TokenEnumerator::kNoSecurityToken, "", 1);
+ CHECK_NE(NULL, profile);
+
+ int actual_depth = 0;
+ const ProfileNode* node = profile->top_down()->root();
+ while (node->children()->length() > 0) {
+ node = node->children()->last();
+ ++actual_depth;
+ }
+
+ CHECK_EQ(1 + i::TickSample::kMaxFramesCount, actual_depth); // +1 for PC.
+}
+
+
TEST(DeleteAllCpuProfiles) {
InitializeVM();
TestSetup test_setup;
« no previous file with comments | « src/cpu-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698