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