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

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

Issue 151163005: A64: Synchronize with r16356. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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/test-cpu-ia32.cc ('k') | test/cctest/test-cpu-x64.cc » ('j') | 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 7b5fc2b0fe7f9daa418ef9cc06338284a7bc0281..6d3c2ee136ce2d7e8c8291e83e815023086f2597 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -31,6 +31,7 @@
#include "cpu-profiler-inl.h"
#include "cctest.h"
#include "platform.h"
+#include "smart-pointers.h"
#include "utils.h"
#include "../include/v8-profiler.h"
using i::CodeEntry;
@@ -42,16 +43,17 @@ using i::ProfileGenerator;
using i::ProfileNode;
using i::ProfilerEventsProcessor;
using i::ScopedVector;
+using i::SmartPointer;
using i::Vector;
TEST(StartStop) {
CpuProfilesCollection profiles;
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
- processor.Start();
- processor.StopSynchronously();
- processor.Join();
+ SmartPointer<ProfilerEventsProcessor> processor(
+ new ProfilerEventsProcessor(&generator, NULL, 100));
+ processor->Start();
+ processor->StopSynchronously();
}
@@ -63,7 +65,7 @@ static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc,
i::Address frame1,
i::Address frame2 = NULL,
i::Address frame3 = NULL) {
- i::TickSample* sample = proc->TickSampleEvent();
+ i::TickSample* sample = proc->StartTickSample();
sample->pc = frame1;
sample->tos = frame1;
sample->frames_count = 0;
@@ -75,6 +77,7 @@ static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc,
sample->stack[1] = frame3;
sample->frames_count = 2;
}
+ proc->FinishTickSample();
}
namespace {
@@ -139,9 +142,10 @@ TEST(CodeEvents) {
CpuProfilesCollection* profiles = new CpuProfilesCollection;
profiles->StartProfiling("", 1, false);
ProfileGenerator generator(profiles);
- ProfilerEventsProcessor processor(&generator);
- processor.Start();
- CpuProfiler profiler(isolate, profiles, &generator, &processor);
+ SmartPointer<ProfilerEventsProcessor> processor(
+ new ProfilerEventsProcessor(&generator, NULL, 100));
+ processor->Start();
+ CpuProfiler profiler(isolate, profiles, &generator, *processor);
// Enqueue code creation events.
const char* aaa_str = "aaa";
@@ -156,10 +160,9 @@ TEST(CodeEvents) {
profiler.CodeCreateEvent(i::Logger::STUB_TAG, args4_code, 4);
// Enqueue a tick event to enable code events processing.
- EnqueueTickSampleEvent(&processor, aaa_code->address());
+ EnqueueTickSampleEvent(*processor, aaa_code->address());
- processor.StopSynchronously();
- processor.Join();
+ processor->StopSynchronously();
// Check the state of profile generator.
CodeEntry* aaa = generator.code_map()->FindEntry(aaa_code->address());
@@ -201,27 +204,27 @@ TEST(TickEvents) {
CpuProfilesCollection* profiles = new CpuProfilesCollection;
profiles->StartProfiling("", 1, false);
ProfileGenerator generator(profiles);
- ProfilerEventsProcessor processor(&generator);
- processor.Start();
- CpuProfiler profiler(isolate, profiles, &generator, &processor);
+ SmartPointer<ProfilerEventsProcessor> processor(
+ new ProfilerEventsProcessor(&generator, NULL, 100));
+ processor->Start();
+ CpuProfiler profiler(isolate, profiles, &generator, *processor);
profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, frame1_code, "bbb");
profiler.CodeCreateEvent(i::Logger::STUB_TAG, frame2_code, 5);
profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, frame3_code, "ddd");
- EnqueueTickSampleEvent(&processor, frame1_code->instruction_start());
+ EnqueueTickSampleEvent(*processor, frame1_code->instruction_start());
EnqueueTickSampleEvent(
- &processor,
+ *processor,
frame2_code->instruction_start() + frame2_code->ExecutableSize() / 2,
frame1_code->instruction_start() + frame2_code->ExecutableSize() / 2);
EnqueueTickSampleEvent(
- &processor,
+ *processor,
frame3_code->instruction_end() - 1,
frame2_code->instruction_end() - 1,
frame1_code->instruction_end() - 1);
- processor.StopSynchronously();
- processor.Join();
+ processor->StopSynchronously();
CpuProfile* profile = profiles->StopProfiling("");
CHECK_NE(NULL, profile);
@@ -270,22 +273,23 @@ TEST(Issue1398) {
CpuProfilesCollection* profiles = new CpuProfilesCollection;
profiles->StartProfiling("", 1, false);
ProfileGenerator generator(profiles);
- ProfilerEventsProcessor processor(&generator);
- processor.Start();
- CpuProfiler profiler(isolate, profiles, &generator, &processor);
+ SmartPointer<ProfilerEventsProcessor> processor(
+ new ProfilerEventsProcessor(&generator, NULL, 100));
+ processor->Start();
+ CpuProfiler profiler(isolate, profiles, &generator, *processor);
profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, code, "bbb");
- i::TickSample* sample = processor.TickSampleEvent();
+ i::TickSample* sample = processor->StartTickSample();
sample->pc = code->address();
sample->tos = 0;
sample->frames_count = i::TickSample::kMaxFramesCount;
for (int i = 0; i < sample->frames_count; ++i) {
sample->stack[i] = code->address();
}
+ processor->FinishTickSample();
- processor.StopSynchronously();
- processor.Join();
+ processor->StopSynchronously();
CpuProfile* profile = profiles->StopProfiling("");
CHECK_NE(NULL, profile);
@@ -1368,13 +1372,11 @@ TEST(IdleTime) {
const v8::CpuProfileNode* programNode =
GetChild(root, ProfileGenerator::kProgramEntryName);
CHECK_EQ(0, programNode->GetChildrenCount());
- CHECK_GE(programNode->GetSelfSamplesCount(), 3);
CHECK_GE(programNode->GetHitCount(), 3);
const v8::CpuProfileNode* idleNode =
GetChild(root, ProfileGenerator::kIdleEntryName);
CHECK_EQ(0, idleNode->GetChildrenCount());
- CHECK_GE(idleNode->GetSelfSamplesCount(), 3);
CHECK_GE(idleNode->GetHitCount(), 3);
cpu_profiler->DeleteAllCpuProfiles();
« no previous file with comments | « test/cctest/test-cpu-ia32.cc ('k') | test/cctest/test-cpu-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698