| Index: runtime/vm/profiler.h
|
| diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
|
| index 4f7ce963695d16e42d083922a8dfd6a5d4faa7c2..1ea5f2dac223ca1cefa1fc24b93e1d6893362f38 100644
|
| --- a/runtime/vm/profiler.h
|
| +++ b/runtime/vm/profiler.h
|
| @@ -52,9 +52,7 @@ class Profiler : public AllStatic {
|
| static void SetSampleDepth(intptr_t depth);
|
| static void SetSamplePeriod(intptr_t period);
|
|
|
| - static SampleBuffer* sample_buffer() {
|
| - return sample_buffer_;
|
| - }
|
| + static SampleBuffer* sample_buffer() { return sample_buffer_; }
|
|
|
| static void DumpStackTrace(bool native_stack_trace = true);
|
|
|
| @@ -68,8 +66,7 @@ class Profiler : public AllStatic {
|
| // * Allocating memory -- Because this takes locks which may already be
|
| // held, resulting in a dead lock.
|
| // * Taking a lock -- See above.
|
| - static void SampleThread(Thread* thread,
|
| - const InterruptedThreadState& state);
|
| + static void SampleThread(Thread* thread, const InterruptedThreadState& state);
|
|
|
| static ProfilerCounters counters() {
|
| // Copies the counter values.
|
| @@ -91,22 +88,16 @@ class Profiler : public AllStatic {
|
|
|
| class SampleVisitor : public ValueObject {
|
| public:
|
| - explicit SampleVisitor(Isolate* isolate) : isolate_(isolate), visited_(0) { }
|
| + explicit SampleVisitor(Isolate* isolate) : isolate_(isolate), visited_(0) {}
|
| virtual ~SampleVisitor() {}
|
|
|
| virtual void VisitSample(Sample* sample) = 0;
|
|
|
| - intptr_t visited() const {
|
| - return visited_;
|
| - }
|
| + intptr_t visited() const { return visited_; }
|
|
|
| - void IncrementVisited() {
|
| - visited_++;
|
| - }
|
| + void IncrementVisited() { visited_++; }
|
|
|
| - Isolate* isolate() const {
|
| - return isolate_;
|
| - }
|
| + Isolate* isolate() const { return isolate_; }
|
|
|
| private:
|
| Isolate* isolate_;
|
| @@ -130,17 +121,13 @@ class SampleFilter : public ValueObject {
|
| ASSERT(time_origin_micros_ >= -1);
|
| ASSERT(time_extent_micros_ >= -1);
|
| }
|
| - virtual ~SampleFilter() { }
|
| + virtual ~SampleFilter() {}
|
|
|
| // Override this function.
|
| // Return |true| if |sample| passes the filter.
|
| - virtual bool FilterSample(Sample* sample) {
|
| - return true;
|
| - }
|
| + virtual bool FilterSample(Sample* sample) { return true; }
|
|
|
| - Isolate* isolate() const {
|
| - return isolate_;
|
| - }
|
| + Isolate* isolate() const { return isolate_; }
|
|
|
| // Returns |true| if |sample| passes the time filter.
|
| bool TimeFilterSample(Sample* sample);
|
| @@ -175,14 +162,10 @@ class Sample {
|
| }
|
|
|
| // Isolate sample was taken from.
|
| - Isolate* isolate() const {
|
| - return isolate_;
|
| - }
|
| + Isolate* isolate() const { return isolate_; }
|
|
|
| // Thread sample was taken on.
|
| - ThreadId tid() const {
|
| - return tid_;
|
| - }
|
| + ThreadId tid() const { return tid_; }
|
|
|
| void Clear() {
|
| isolate_ = NULL;
|
| @@ -204,14 +187,10 @@ class Sample {
|
| }
|
|
|
| // Timestamp sample was taken at.
|
| - int64_t timestamp() const {
|
| - return timestamp_;
|
| - }
|
| + int64_t timestamp() const { return timestamp_; }
|
|
|
| // Top most pc.
|
| - uword pc() const {
|
| - return At(0);
|
| - }
|
| + uword pc() const { return At(0); }
|
|
|
| // Get stack trace entry.
|
| uword At(intptr_t i) const {
|
| @@ -229,56 +208,36 @@ class Sample {
|
| pcs[i] = pc;
|
| }
|
|
|
| - uword vm_tag() const {
|
| - return vm_tag_;
|
| - }
|
| + uword vm_tag() const { return vm_tag_; }
|
| void set_vm_tag(uword tag) {
|
| ASSERT(tag != VMTag::kInvalidTagId);
|
| vm_tag_ = tag;
|
| }
|
|
|
| - uword user_tag() const {
|
| - return user_tag_;
|
| - }
|
| - void set_user_tag(uword tag) {
|
| - user_tag_ = tag;
|
| - }
|
| + uword user_tag() const { return user_tag_; }
|
| + void set_user_tag(uword tag) { user_tag_ = tag; }
|
|
|
| - uword pc_marker() const {
|
| - return pc_marker_;
|
| - }
|
| + uword pc_marker() const { return pc_marker_; }
|
|
|
| - void set_pc_marker(uword pc_marker) {
|
| - pc_marker_ = pc_marker;
|
| - }
|
| + void set_pc_marker(uword pc_marker) { pc_marker_ = pc_marker; }
|
|
|
| - uword lr() const {
|
| - return lr_;
|
| - }
|
| + uword lr() const { return lr_; }
|
|
|
| - void set_lr(uword link_register) {
|
| - lr_ = link_register;
|
| - }
|
| + void set_lr(uword link_register) { lr_ = link_register; }
|
|
|
| - bool leaf_frame_is_dart() const {
|
| - return LeafFrameIsDart::decode(state_);
|
| - }
|
| + bool leaf_frame_is_dart() const { return LeafFrameIsDart::decode(state_); }
|
|
|
| void set_leaf_frame_is_dart(bool leaf_frame_is_dart) {
|
| state_ = LeafFrameIsDart::update(leaf_frame_is_dart, state_);
|
| }
|
|
|
| - bool ignore_sample() const {
|
| - return IgnoreBit::decode(state_);
|
| - }
|
| + bool ignore_sample() const { return IgnoreBit::decode(state_); }
|
|
|
| void set_ignore_sample(bool ignore_sample) {
|
| state_ = IgnoreBit::update(ignore_sample, state_);
|
| }
|
|
|
| - bool exit_frame_sample() const {
|
| - return ExitFrameBit::decode(state_);
|
| - }
|
| + bool exit_frame_sample() const { return ExitFrameBit::decode(state_); }
|
|
|
| void set_exit_frame_sample(bool exit_frame_sample) {
|
| state_ = ExitFrameBit::update(exit_frame_sample, state_);
|
| @@ -292,9 +251,7 @@ class Sample {
|
| state_ = MissingFrameInsertedBit::update(missing_frame_inserted, state_);
|
| }
|
|
|
| - bool truncated_trace() const {
|
| - return TruncatedTraceBit::decode(state_);
|
| - }
|
| + bool truncated_trace() const { return TruncatedTraceBit::decode(state_); }
|
|
|
| void set_truncated_trace(bool truncated_trace) {
|
| state_ = TruncatedTraceBit::update(truncated_trace, state_);
|
| @@ -308,9 +265,7 @@ class Sample {
|
| state_ = ClassAllocationSampleBit::update(allocation_sample, state_);
|
| }
|
|
|
| - Thread::TaskKind thread_task() const {
|
| - return ThreadTaskBit::decode(state_);
|
| - }
|
| + Thread::TaskKind thread_task() const { return ThreadTaskBit::decode(state_); }
|
|
|
| void set_thread_task(Thread::TaskKind task) {
|
| state_ = ThreadTaskBit::update(task, state_);
|
| @@ -342,13 +297,9 @@ class Sample {
|
| state_ = HeadSampleBit::update(head_sample, state_);
|
| }
|
|
|
| - bool head_sample() const {
|
| - return HeadSampleBit::decode(state_);
|
| - }
|
| + bool head_sample() const { return HeadSampleBit::decode(state_); }
|
|
|
| - void set_metadata(intptr_t metadata) {
|
| - metadata_ = metadata;
|
| - }
|
| + void set_metadata(intptr_t metadata) { metadata_ = metadata; }
|
|
|
| void SetAllocationCid(intptr_t cid) {
|
| set_is_allocation_sample(true);
|
| @@ -357,16 +308,12 @@ class Sample {
|
|
|
| static void InitOnce();
|
|
|
| - static intptr_t instance_size() {
|
| - return instance_size_;
|
| - }
|
| + static intptr_t instance_size() { return instance_size_; }
|
|
|
| uword* GetPCArray() const;
|
|
|
| static const int kStackBufferSizeInWords = 2;
|
| - uword* GetStackBuffer() {
|
| - return &stack_buffer_[0];
|
| - }
|
| + uword* GetStackBuffer() { return &stack_buffer_[0]; }
|
|
|
| private:
|
| static intptr_t instance_size_;
|
| @@ -384,14 +331,14 @@ class Sample {
|
| kNextFreeBit = 13,
|
| };
|
| class HeadSampleBit : public BitField<uword, bool, kHeadSampleBit, 1> {};
|
| - class LeafFrameIsDart :
|
| - public BitField<uword, bool, kLeafFrameIsDartBit, 1> {};
|
| + class LeafFrameIsDart : public BitField<uword, bool, kLeafFrameIsDartBit, 1> {
|
| + };
|
| class IgnoreBit : public BitField<uword, bool, kIgnoreBit, 1> {};
|
| class ExitFrameBit : public BitField<uword, bool, kExitFrameBit, 1> {};
|
| class MissingFrameInsertedBit
|
| : public BitField<uword, bool, kMissingFrameInsertedBit, 1> {};
|
| - class TruncatedTraceBit :
|
| - public BitField<uword, bool, kTruncatedTraceBit, 1> {};
|
| + class TruncatedTraceBit
|
| + : public BitField<uword, bool, kTruncatedTraceBit, 1> {};
|
| class ClassAllocationSampleBit
|
| : public BitField<uword, bool, kClassAllocationSampleBit, 1> {};
|
| class ContinuationSampleBit
|
| @@ -429,21 +376,16 @@ class CodeDescriptor : public ZoneAllocated {
|
|
|
| int64_t CompileTimestamp() const;
|
|
|
| - RawCode* code() const {
|
| - return code_.raw();
|
| - }
|
| + RawCode* code() const { return code_.raw(); }
|
|
|
| - const char* Name() const {
|
| - return code_.Name();
|
| - }
|
| + const char* Name() const { return code_.Name(); }
|
|
|
| bool Contains(uword pc) const {
|
| uword end = Start() + Size();
|
| return (pc >= Start()) && (pc < end);
|
| }
|
|
|
| - static int Compare(CodeDescriptor* const* a,
|
| - CodeDescriptor* const* b) {
|
| + static int Compare(CodeDescriptor* const* a, CodeDescriptor* const* b) {
|
| ASSERT(a != NULL);
|
| ASSERT(b != NULL);
|
|
|
| @@ -471,9 +413,7 @@ class CodeLookupTable : public ZoneAllocated {
|
| public:
|
| explicit CodeLookupTable(Thread* thread);
|
|
|
| - intptr_t length() const {
|
| - return code_objects_.length();
|
| - }
|
| + intptr_t length() const { return code_objects_.length(); }
|
|
|
| const CodeDescriptor* At(intptr_t index) const {
|
| return code_objects_.At(index);
|
| @@ -571,14 +511,10 @@ class ProcessedSample : public ZoneAllocated {
|
| ProcessedSample();
|
|
|
| // Add |pc| to stack trace.
|
| - void Add(uword pc) {
|
| - pcs_.Add(pc);
|
| - }
|
| + void Add(uword pc) { pcs_.Add(pc); }
|
|
|
| // Insert |pc| at |index|.
|
| - void InsertAt(intptr_t index, uword pc) {
|
| - pcs_.InsertAt(index, pc);
|
| - }
|
| + void InsertAt(intptr_t index, uword pc) { pcs_.InsertAt(index, pc); }
|
|
|
| // Number of pcs in stack trace.
|
| intptr_t length() const { return pcs_.length(); }
|
| @@ -609,9 +545,7 @@ class ProcessedSample : public ZoneAllocated {
|
| intptr_t allocation_cid() const { return allocation_cid_; }
|
| void set_allocation_cid(intptr_t cid) { allocation_cid_ = cid; }
|
|
|
| - bool IsAllocationSample() const {
|
| - return allocation_cid_ > 0;
|
| - }
|
| + bool IsAllocationSample() const { return allocation_cid_ > 0; }
|
|
|
| // Was the stack trace truncated?
|
| bool truncated() const { return truncated_; }
|
| @@ -659,17 +593,11 @@ class ProcessedSampleBuffer : public ZoneAllocated {
|
| public:
|
| ProcessedSampleBuffer();
|
|
|
| - void Add(ProcessedSample* sample) {
|
| - samples_.Add(sample);
|
| - }
|
| + void Add(ProcessedSample* sample) { samples_.Add(sample); }
|
|
|
| - intptr_t length() const {
|
| - return samples_.length();
|
| - }
|
| + intptr_t length() const { return samples_.length(); }
|
|
|
| - ProcessedSample* At(intptr_t index) {
|
| - return samples_.At(index);
|
| - }
|
| + ProcessedSample* At(intptr_t index) { return samples_.At(index); }
|
|
|
| const CodeLookupTable& code_lookup_table() const {
|
| return *code_lookup_table_;
|
|
|