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

Unified Diff: src/cpu-profiler.cc

Issue 22849002: Rewrite SamplingCircularQueue (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use V8_ALIGNAS from include/v8config.h Created 7 years, 4 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/cpu-profiler.h ('k') | src/cpu-profiler-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index 747542f73781d79efc5ec5d297af6d7b6c1020da..ed7d5a939191eba785b017847f128b4000b6519d 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -40,8 +40,6 @@
namespace v8 {
namespace internal {
-static const int kTickSamplesBufferChunkSize = 64 * KB;
-static const int kTickSamplesBufferChunksCount = 16;
static const int kProfilerStackSize = 64 * KB;
@@ -49,9 +47,6 @@ ProfilerEventsProcessor::ProfilerEventsProcessor(ProfileGenerator* generator)
: Thread(Thread::Options("v8:ProfEvntProc", kProfilerStackSize)),
generator_(generator),
running_(true),
- ticks_buffer_(sizeof(TickSampleEventRecord),
- kTickSamplesBufferChunkSize,
- kTickSamplesBufferChunksCount),
last_code_event_id_(0), last_processed_code_event_id_(0) {
}
@@ -114,23 +109,10 @@ bool ProfilerEventsProcessor::ProcessTicks() {
generator_->RecordTickSample(record.sample);
}
- const TickSampleEventRecord* rec =
- TickSampleEventRecord::cast(ticks_buffer_.StartDequeue());
- if (rec == NULL) return !ticks_from_vm_buffer_.IsEmpty();
- // Make a local copy of tick sample record to ensure that it won't
- // be modified as we are processing it. This is possible as the
- // sampler writes w/o any sync to the queue, so if the processor
- // will get far behind, a record may be modified right under its
- // feet.
- TickSampleEventRecord record = *rec;
- if (record.order != last_processed_code_event_id_) return true;
-
- // A paranoid check to make sure that we don't get a memory overrun
- // in case of frames_count having a wild value.
- if (record.sample.frames_count < 0
- || record.sample.frames_count > TickSample::kMaxFramesCount)
- record.sample.frames_count = 0;
- generator_->RecordTickSample(record.sample);
+ const TickSampleEventRecord* record = ticks_buffer_.StartDequeue();
+ if (record == NULL) return !ticks_from_vm_buffer_.IsEmpty();
+ if (record->order != last_processed_code_event_id_) return true;
+ generator_->RecordTickSample(record->sample);
ticks_buffer_.FinishDequeue();
}
}
@@ -148,7 +130,6 @@ void ProfilerEventsProcessor::Run() {
}
// Process remaining tick events.
- ticks_buffer_.FlushResidualRecords();
do {
ProcessTicks();
} while (ProcessCodeEvent());
@@ -166,12 +147,6 @@ CpuProfile* CpuProfiler::GetProfile(int index) {
}
-TickSample* CpuProfiler::TickSampleEvent() {
- if (is_profiling_) return processor_->TickSampleEvent();
- return NULL;
-}
-
-
void CpuProfiler::DeleteAllProfiles() {
if (is_profiling_) StopProcessor();
ResetProfiles();
« no previous file with comments | « src/cpu-profiler.h ('k') | src/cpu-profiler-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698