OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/profiler/cpu-profiler.h" | 5 #include "src/profiler/cpu-profiler.h" |
6 | 6 |
7 #include "src/debug/debug.h" | 7 #include "src/debug/debug.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/locked-queue-inl.h" | 10 #include "src/locked-queue-inl.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 } | 107 } |
108 | 108 |
109 const TickSampleEventRecord* record = ticks_buffer_.Peek(); | 109 const TickSampleEventRecord* record = ticks_buffer_.Peek(); |
110 if (record == NULL) { | 110 if (record == NULL) { |
111 if (ticks_from_vm_buffer_.IsEmpty()) return NoSamplesInQueue; | 111 if (ticks_from_vm_buffer_.IsEmpty()) return NoSamplesInQueue; |
112 return FoundSampleForNextCodeEvent; | 112 return FoundSampleForNextCodeEvent; |
113 } | 113 } |
114 if (record->order != last_processed_code_event_id_) { | 114 if (record->order != last_processed_code_event_id_) { |
115 return FoundSampleForNextCodeEvent; | 115 return FoundSampleForNextCodeEvent; |
116 } | 116 } |
117 generator_->RecordTickSample(record->sample); | 117 if (record->sample.pc) { |
titzer
2016/02/19 09:28:37
Will this tick just be discarded? Is there a bucke
alph
2016/02/19 16:24:29
It is just discarded, so effectively it adds to al
titzer
2016/02/19 16:36:33
As long as the missing samples go somewhere, so as
alph
2016/02/19 17:54:22
Agree.
| |
118 generator_->RecordTickSample(record->sample); | |
119 } | |
118 ticks_buffer_.Remove(); | 120 ticks_buffer_.Remove(); |
119 return OneSampleProcessed; | 121 return OneSampleProcessed; |
120 } | 122 } |
121 | 123 |
122 | 124 |
123 void ProfilerEventsProcessor::Run() { | 125 void ProfilerEventsProcessor::Run() { |
124 while (!!base::NoBarrier_Load(&running_)) { | 126 while (!!base::NoBarrier_Load(&running_)) { |
125 base::TimeTicks nextSampleTime = | 127 base::TimeTicks nextSampleTime = |
126 base::TimeTicks::HighResolutionNow() + period_; | 128 base::TimeTicks::HighResolutionNow() + period_; |
127 base::TimeTicks now; | 129 base::TimeTicks now; |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
526 Builtins::Name id = static_cast<Builtins::Name>(i); | 528 Builtins::Name id = static_cast<Builtins::Name>(i); |
527 rec->start = builtins->builtin(id)->address(); | 529 rec->start = builtins->builtin(id)->address(); |
528 rec->builtin_id = id; | 530 rec->builtin_id = id; |
529 processor_->Enqueue(evt_rec); | 531 processor_->Enqueue(evt_rec); |
530 } | 532 } |
531 } | 533 } |
532 | 534 |
533 | 535 |
534 } // namespace internal | 536 } // namespace internal |
535 } // namespace v8 | 537 } // namespace v8 |
OLD | NEW |