#include <profiler.h>
Definition at line 641 of file profiler.h.
◆ State
Enumerator |
---|
kFree | |
kSampling | |
kCompleted | |
kStreaming | |
Definition at line 718 of file profiler.h.
◆ SampleBlock()
dart::SampleBlock::SampleBlock |
( |
| ) |
|
|
default |
◆ ~SampleBlock()
virtual dart::SampleBlock::~SampleBlock |
( |
| ) |
|
|
virtualdefault |
◆ capacity()
intptr_t dart::SampleBlock::capacity |
( |
| ) |
const |
|
inline |
◆ FreeCompleted()
void dart::SampleBlock::FreeCompleted |
( |
| ) |
|
|
inline |
Definition at line 704 of file profiler.h.
704 {
707 std::memory_order success_order = std::memory_order_acquire;
708 std::memory_order failure_order = std::memory_order_relaxed;
709 if (
state_.compare_exchange_strong(expected, desired, success_order,
710 failure_order)) {
712 }
713 }
std::atomic< State > state_
◆ HasStreamableSamples()
Definition at line 724 of file profiler.cc.
725 {
726 for (intptr_t i = 0; i <
capacity_; ++i) {
728 uword sample_tag = sample->user_tag();
729 for (intptr_t j = 0; j < tag_table.Length(); ++j) {
730 *tag ^= tag_table.At(j);
731 if (tag->tag() == sample_tag && tag->streamable()) {
732 return true;
733 }
734 }
735 }
736 return false;
737}
Sample * At(intptr_t idx) const
◆ MarkCompleted()
void dart::SampleBlock::MarkCompleted |
( |
| ) |
|
|
inline |
◆ owner()
Isolate * dart::SampleBlock::owner |
( |
| ) |
const |
|
inline |
◆ ReserveSample()
Sample * dart::SampleBlock::ReserveSample |
( |
| ) |
|
|
virtual |
Implements dart::SampleBuffer.
Definition at line 785 of file profiler.cc.
785 {
789 }
790 return nullptr;
791}
T fetch_add(T arg, std::memory_order order=std::memory_order_relaxed)
RelaxedAtomic< uint32_t > cursor_
◆ ReserveSampleAndLink()
Sample * dart::SampleBlock::ReserveSampleAndLink |
( |
Sample * |
previous | ) |
|
|
virtual |
Implements dart::SampleBuffer.
Definition at line 793 of file profiler.cc.
793 {
794 ASSERT(previous !=
nullptr);
796 Isolate* isolate =
owner_;
797 ASSERT(isolate !=
nullptr);
798 Sample*
next = previous->is_allocation_sample()
799 ?
buffer->ReserveAllocationSample(isolate)
800 :
buffer->ReserveCPUSample(isolate);
801 if (
next ==
nullptr) {
802 return nullptr;
803 }
804 next->Init(previous->port(), previous->timestamp(), previous->tid());
805 next->set_head_sample(
false);
806
807 previous->SetContinuation(
next);
809}
static float next(float f)
static SampleBlockBuffer * sample_block_buffer()
friend class SampleBlockBuffer
static const uint8_t buffer[]
◆ set_owner()
void dart::SampleBlock::set_owner |
( |
Isolate * |
isolate | ) |
|
|
inline |
◆ StreamingToCompleted()
void dart::SampleBlock::StreamingToCompleted |
( |
| ) |
|
|
inline |
◆ StreamingToFree()
void dart::SampleBlock::StreamingToFree |
( |
| ) |
|
|
inline |
Definition at line 698 of file profiler.h.
698 {
703 }
void store(T arg, std::memory_order order=std::memory_order_relaxed)
◆ TryAcquireStreaming()
bool dart::SampleBlock::TryAcquireStreaming |
( |
Isolate * |
isolate | ) |
|
|
inline |
Definition at line 683 of file profiler.h.
683 {
685 if (
owner_ != isolate)
return false;
686
689 std::memory_order success_order = std::memory_order_acquire;
690 std::memory_order failure_order = std::memory_order_relaxed;
691 return state_.compare_exchange_strong(expected, desired, success_order,
692 failure_order);
693 }
◆ TryAllocateCompleted()
bool dart::SampleBlock::TryAllocateCompleted |
( |
| ) |
|
|
inline |
Definition at line 666 of file profiler.h.
666 {
669 std::memory_order success_order = std::memory_order_acquire;
670 std::memory_order failure_order = std::memory_order_relaxed;
671 if (
state_.compare_exchange_strong(expected, desired, success_order,
672 failure_order)) {
675 return true;
676 }
677 return false;
678 }
◆ TryAllocateFree()
bool dart::SampleBlock::TryAllocateFree |
( |
| ) |
|
|
inline |
Definition at line 658 of file profiler.h.
658 {
661 std::memory_order success_order = std::memory_order_acquire;
662 std::memory_order failure_order = std::memory_order_relaxed;
663 return state_.compare_exchange_strong(expected, desired, success_order,
664 failure_order);
665 }
◆ SampleBlockBuffer
◆ SampleBlockListProcessor
friend class SampleBlockListProcessor |
|
friend |
◆ cursor_
◆ kSamplesPerBlock
constexpr intptr_t dart::SampleBlock::kSamplesPerBlock = 100 |
|
staticconstexpr |
◆ owner_
Isolate* dart::SampleBlock::owner_ = nullptr |
|
protected |
◆ state_
std::atomic<State> dart::SampleBlock::state_ = kFree |
|
protected |
The documentation for this class was generated from the following files: