Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Attributes | List of all members
dart::SampleFilter Class Reference

#include <profiler.h>

Inheritance diagram for dart::SampleFilter:
dart::ValueObject dart::AllocationFilter dart::AllocationSampleFilter dart::ClassAllocationSampleFilter dart::NoAllocationSampleFilter dart::StreamableSampleFilter

Public Member Functions

 SampleFilter (Dart_Port port, intptr_t thread_task_mask, int64_t time_origin_micros, int64_t time_extent_micros, bool take_samples=false)
 
virtual ~SampleFilter ()
 
virtual bool FilterSample (Sample *sample)
 
Dart_Port port () const
 
bool TimeFilterSample (Sample *sample)
 
bool TaskFilterSample (Sample *sample)
 
bool take_samples () const
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Static Public Attributes

static constexpr intptr_t kNoTaskFilter = -1
 

Detailed Description

Definition at line 145 of file profiler.h.

Constructor & Destructor Documentation

◆ SampleFilter()

dart::SampleFilter::SampleFilter ( Dart_Port  port,
intptr_t  thread_task_mask,
int64_t  time_origin_micros,
int64_t  time_extent_micros,
bool  take_samples = false 
)
inline

Definition at line 147 of file profiler.h.

152 : port_(port),
153 thread_task_mask_(thread_task_mask),
154 time_origin_micros_(time_origin_micros),
155 time_extent_micros_(time_extent_micros),
156 take_samples_(take_samples) {
157 ASSERT(thread_task_mask != 0);
158 ASSERT(time_origin_micros_ >= -1);
159 ASSERT(time_extent_micros_ >= -1);
160 }
Dart_Port port() const
Definition: profiler.h:167
bool take_samples() const
Definition: profiler.h:175
#define ASSERT(E)

◆ ~SampleFilter()

virtual dart::SampleFilter::~SampleFilter ( )
inlinevirtual

Definition at line 161 of file profiler.h.

161{}

Member Function Documentation

◆ FilterSample()

virtual bool dart::SampleFilter::FilterSample ( Sample sample)
inlinevirtual

◆ port()

Dart_Port dart::SampleFilter::port ( ) const
inline

Definition at line 167 of file profiler.h.

167{ return port_; }

◆ take_samples()

bool dart::SampleFilter::take_samples ( ) const
inline

Definition at line 175 of file profiler.h.

175{ return take_samples_; }

◆ TaskFilterSample()

bool dart::SampleFilter::TaskFilterSample ( Sample sample)

Definition at line 985 of file profiler.cc.

985 {
986 const intptr_t task = static_cast<intptr_t>(sample->thread_task());
987 if (thread_task_mask_ == kNoTaskFilter) {
988 return true;
989 }
990 return (task & thread_task_mask_) != 0;
991}
static constexpr intptr_t kNoTaskFilter
Definition: profiler.h:177

◆ TimeFilterSample()

bool dart::SampleFilter::TimeFilterSample ( Sample sample)

Definition at line 975 of file profiler.cc.

975 {
976 if ((time_origin_micros_ == -1) || (time_extent_micros_ == -1)) {
977 // No time filter passed in, always pass.
978 return true;
979 }
980 const int64_t timestamp = sample->timestamp();
981 int64_t delta = timestamp - time_origin_micros_;
982 return (delta >= 0) && (delta <= time_extent_micros_);
983}

Member Data Documentation

◆ kNoTaskFilter

constexpr intptr_t dart::SampleFilter::kNoTaskFilter = -1
staticconstexpr

Definition at line 177 of file profiler.h.


The documentation for this class was generated from the following files: