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

Side by Side Diff: test/cctest/test-profile-generator.cc

Issue 3287005: CPU profiler: limit the number of simultaneously collected profiles. (Closed)
Patch Set: Created 10 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/profile-generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // 2 //
3 // Tests of profiles generator and utilities. 3 // Tests of profiles generator and utilities.
4 4
5 #ifdef ENABLE_LOGGING_AND_PROFILING 5 #ifdef ENABLE_LOGGING_AND_PROFILING
6 6
7 #include "v8.h" 7 #include "v8.h"
8 #include "profile-generator-inl.h" 8 #include "profile-generator-inl.h"
9 #include "cctest.h" 9 #include "cctest.h"
10 #include "../include/v8-profiler.h" 10 #include "../include/v8-profiler.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); 768 CHECK_NE(NULL, const_cast<ProfileNode*>(current));
769 current = PickChild(current, "a"); 769 current = PickChild(current, "a");
770 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); 770 CHECK_NE(NULL, const_cast<ProfileNode*>(current));
771 current = PickChild(current, "b"); 771 current = PickChild(current, "b");
772 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); 772 CHECK_NE(NULL, const_cast<ProfileNode*>(current));
773 current = PickChild(current, "c"); 773 current = PickChild(current, "c");
774 CHECK_NE(NULL, const_cast<ProfileNode*>(current)); 774 CHECK_NE(NULL, const_cast<ProfileNode*>(current));
775 CHECK_EQ(0, current->children()->length()); 775 CHECK_EQ(0, current->children()->length());
776 } 776 }
777 777
778
779 TEST(Issue51919) {
780 CpuProfilesCollection collection;
781 i::EmbeddedVector<char*,
782 CpuProfilesCollection::kMaxSimultaneousProfiles> titles;
783 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) {
784 i::Vector<char> title = i::Vector<char>::New(16);
785 i::OS::SNPrintF(title, "%d", i);
786 CHECK(collection.StartProfiling(title.start(), i + 1)); // UID must be > 0.
787 titles[i] = title.start();
788 }
789 CHECK(!collection.StartProfiling(
790 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1));
791 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i)
792 i::DeleteArray(titles[i]);
793 }
794
778 #endif // ENABLE_LOGGING_AND_PROFILING 795 #endif // ENABLE_LOGGING_AND_PROFILING
OLDNEW
« no previous file with comments | « src/profile-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698