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

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

Issue 11065034: Rollback trunk to bleeding_edge revision 12524 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 2 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/version.cc ('k') | test/mjsunit/elements-transition-hoisting.js » ('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 b10e6889ec8f9bd6f7d283a3d2f4eff049b7ba7a..589e6d8c592476421e6897a382355d459653a3ff 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -5,6 +5,7 @@
#include "v8.h"
#include "cpu-profiler-inl.h"
#include "cctest.h"
+#include "platform.h"
#include "../include/v8-profiler.h"
using i::CodeEntry;
@@ -20,7 +21,7 @@ using i::TokenEnumerator;
TEST(StartStop) {
CpuProfilesCollection profiles;
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
+ ProfilerEventsProcessor processor(&generator, NULL, 1000);
processor.Start();
processor.Stop();
processor.Join();
@@ -38,11 +39,13 @@ static inline i::Address ToAddress(int n) {
return reinterpret_cast<i::Address>(n);
}
-static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc,
- i::Address frame1,
- i::Address frame2 = NULL,
- i::Address frame3 = NULL) {
- i::TickSample* sample = proc->TickSampleEvent();
+static void AddTickSampleEvent(ProfilerEventsProcessor* processor,
+ i::Address frame1,
+ i::Address frame2 = NULL,
+ i::Address frame3 = NULL) {
+ i::TickSample* sample;
+ i::OS::Sleep(20);
+ while ((sample = processor->StartTickSampleEvent()) == NULL) i::OS::Sleep(20);
sample->pc = frame1;
sample->tos = frame1;
sample->frames_count = 0;
@@ -54,6 +57,7 @@ static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc,
sample->stack[1] = frame3;
sample->frames_count = 2;
}
+ processor->FinishTickSampleEvent();
}
namespace {
@@ -81,7 +85,7 @@ TEST(CodeEvents) {
CpuProfilesCollection profiles;
profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
+ ProfilerEventsProcessor processor(&generator, NULL, 1000);
processor.Start();
// Enqueue code creation events.
@@ -108,8 +112,8 @@ TEST(CodeEvents) {
processor.CodeMoveEvent(ToAddress(0x1400), ToAddress(0x1500));
processor.CodeCreateEvent(i::Logger::STUB_TAG, 3, ToAddress(0x1600), 0x10);
processor.CodeCreateEvent(i::Logger::STUB_TAG, 4, ToAddress(0x1605), 0x10);
- // Enqueue a tick event to enable code events processing.
- EnqueueTickSampleEvent(&processor, ToAddress(0x1000));
+ // Add a tick event to enable code events processing.
+ AddTickSampleEvent(&processor, ToAddress(0x1000));
processor.Stop();
processor.Join();
@@ -142,7 +146,7 @@ TEST(TickEvents) {
CpuProfilesCollection profiles;
profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
+ ProfilerEventsProcessor processor(&generator, NULL, 1000);
processor.Start();
processor.CodeCreateEvent(i::Logger::BUILTIN_TAG,
@@ -154,12 +158,12 @@ TEST(TickEvents) {
"ddd",
ToAddress(0x1400),
0x80);
- EnqueueTickSampleEvent(&processor, ToAddress(0x1210));
- EnqueueTickSampleEvent(&processor, ToAddress(0x1305), ToAddress(0x1220));
- EnqueueTickSampleEvent(&processor,
- ToAddress(0x1404),
- ToAddress(0x1305),
- ToAddress(0x1230));
+ AddTickSampleEvent(&processor, ToAddress(0x1210));
+ AddTickSampleEvent(&processor, ToAddress(0x1305), ToAddress(0x1220));
+ AddTickSampleEvent(&processor,
+ ToAddress(0x1404),
+ ToAddress(0x1305),
+ ToAddress(0x1230));
processor.Stop();
processor.Join();
@@ -232,7 +236,7 @@ TEST(Issue1398) {
CpuProfilesCollection profiles;
profiles.StartProfiling("", 1);
ProfileGenerator generator(&profiles);
- ProfilerEventsProcessor processor(&generator);
+ ProfilerEventsProcessor processor(&generator, NULL, 1000);
processor.Start();
processor.CodeCreateEvent(i::Logger::BUILTIN_TAG,
@@ -240,13 +244,14 @@ TEST(Issue1398) {
ToAddress(0x1200),
0x80);
- i::TickSample* sample = processor.TickSampleEvent();
+ i::TickSample* sample = processor.StartTickSampleEvent();
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.FinishTickSampleEvent();
processor.Stop();
processor.Join();
« no previous file with comments | « src/version.cc ('k') | test/mjsunit/elements-transition-hoisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698