OLD | NEW |
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 | |
6 | |
7 #include "v8.h" | 5 #include "v8.h" |
8 #include "profile-generator-inl.h" | 6 #include "profile-generator-inl.h" |
9 #include "cctest.h" | 7 #include "cctest.h" |
10 #include "../include/v8-profiler.h" | 8 #include "../include/v8-profiler.h" |
11 | 9 |
12 namespace i = v8::internal; | 10 namespace i = v8::internal; |
13 | 11 |
14 using i::CodeEntry; | 12 using i::CodeEntry; |
15 using i::CodeMap; | 13 using i::CodeMap; |
16 using i::CpuProfile; | 14 using i::CpuProfile; |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 i::Vector<char> title = i::Vector<char>::New(16); | 815 i::Vector<char> title = i::Vector<char>::New(16); |
818 i::OS::SNPrintF(title, "%d", i); | 816 i::OS::SNPrintF(title, "%d", i); |
819 CHECK(collection.StartProfiling(title.start(), i + 1)); // UID must be > 0. | 817 CHECK(collection.StartProfiling(title.start(), i + 1)); // UID must be > 0. |
820 titles[i] = title.start(); | 818 titles[i] = title.start(); |
821 } | 819 } |
822 CHECK(!collection.StartProfiling( | 820 CHECK(!collection.StartProfiling( |
823 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1)); | 821 "maximum", CpuProfilesCollection::kMaxSimultaneousProfiles + 1)); |
824 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) | 822 for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) |
825 i::DeleteArray(titles[i]); | 823 i::DeleteArray(titles[i]); |
826 } | 824 } |
827 | |
828 #endif // ENABLE_LOGGING_AND_PROFILING | |
OLD | NEW |