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

Side by Side Diff: runtime/vm/profiler.h

Issue 1814813003: Collect samples for background threads. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_PROFILER_H_ 5 #ifndef VM_PROFILER_H_
6 #define VM_PROFILER_H_ 6 #define VM_PROFILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/bitfield.h" 9 #include "vm/bitfield.h"
10 #include "vm/code_observers.h" 10 #include "vm/code_observers.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 268
269 bool is_allocation_sample() const { 269 bool is_allocation_sample() const {
270 return ClassAllocationSampleBit::decode(state_); 270 return ClassAllocationSampleBit::decode(state_);
271 } 271 }
272 272
273 void set_is_allocation_sample(bool allocation_sample) { 273 void set_is_allocation_sample(bool allocation_sample) {
274 state_ = ClassAllocationSampleBit::update(allocation_sample, state_); 274 state_ = ClassAllocationSampleBit::update(allocation_sample, state_);
275 } 275 }
276 276
277 bool is_mutator_thread() const {
278 return MutatorThreadBit::decode(state_);
279 }
280
281 void set_is_mutator_thread(bool mutator_thread) {
282 state_ = MutatorThreadBit::update(mutator_thread, state_);
283 }
284
277 bool is_continuation_sample() const { 285 bool is_continuation_sample() const {
278 return ContinuationSampleBit::decode(state_); 286 return ContinuationSampleBit::decode(state_);
279 } 287 }
280 288
281 void SetContinuationIndex(intptr_t index) { 289 void SetContinuationIndex(intptr_t index) {
282 ASSERT(!is_continuation_sample()); 290 ASSERT(!is_continuation_sample());
283 ASSERT(continuation_index_ == -1); 291 ASSERT(continuation_index_ == -1);
284 state_ = ContinuationSampleBit::update(true, state_); 292 state_ = ContinuationSampleBit::update(true, state_);
285 continuation_index_ = index; 293 continuation_index_ = index;
286 ASSERT(is_continuation_sample()); 294 ASSERT(is_continuation_sample());
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 static intptr_t pcs_length_; 339 static intptr_t pcs_length_;
332 enum StateBits { 340 enum StateBits {
333 kHeadSampleBit = 0, 341 kHeadSampleBit = 0,
334 kLeafFrameIsDartBit = 1, 342 kLeafFrameIsDartBit = 1,
335 kIgnoreBit = 2, 343 kIgnoreBit = 2,
336 kExitFrameBit = 3, 344 kExitFrameBit = 3,
337 kMissingFrameInsertedBit = 4, 345 kMissingFrameInsertedBit = 4,
338 kTruncatedTraceBit = 5, 346 kTruncatedTraceBit = 5,
339 kClassAllocationSampleBit = 6, 347 kClassAllocationSampleBit = 6,
340 kContinuationSampleBit = 7, 348 kContinuationSampleBit = 7,
349 kMutatorThreadBit = 8,
341 }; 350 };
342 class HeadSampleBit : public BitField<uword, bool, kHeadSampleBit, 1> {}; 351 class HeadSampleBit : public BitField<uword, bool, kHeadSampleBit, 1> {};
343 class LeafFrameIsDart : 352 class LeafFrameIsDart :
344 public BitField<uword, bool, kLeafFrameIsDartBit, 1> {}; 353 public BitField<uword, bool, kLeafFrameIsDartBit, 1> {};
345 class IgnoreBit : public BitField<uword, bool, kIgnoreBit, 1> {}; 354 class IgnoreBit : public BitField<uword, bool, kIgnoreBit, 1> {};
346 class ExitFrameBit : public BitField<uword, bool, kExitFrameBit, 1> {}; 355 class ExitFrameBit : public BitField<uword, bool, kExitFrameBit, 1> {};
347 class MissingFrameInsertedBit 356 class MissingFrameInsertedBit
348 : public BitField<uword, bool, kMissingFrameInsertedBit, 1> {}; 357 : public BitField<uword, bool, kMissingFrameInsertedBit, 1> {};
349 class TruncatedTraceBit : 358 class TruncatedTraceBit :
350 public BitField<uword, bool, kTruncatedTraceBit, 1> {}; 359 public BitField<uword, bool, kTruncatedTraceBit, 1> {};
351 class ClassAllocationSampleBit 360 class ClassAllocationSampleBit
352 : public BitField<uword, bool, kClassAllocationSampleBit, 1> {}; 361 : public BitField<uword, bool, kClassAllocationSampleBit, 1> {};
353 class ContinuationSampleBit 362 class ContinuationSampleBit
354 : public BitField<uword, bool, kContinuationSampleBit, 1> {}; 363 : public BitField<uword, bool, kContinuationSampleBit, 1> {};
364 class MutatorThreadBit
365 : public BitField<uword, bool, kMutatorThreadBit, 1> {};
355 366
356 int64_t timestamp_; 367 int64_t timestamp_;
357 ThreadId tid_; 368 ThreadId tid_;
358 Isolate* isolate_; 369 Isolate* isolate_;
359 uword pc_marker_; 370 uword pc_marker_;
360 uword stack_buffer_[kStackBufferSizeInWords]; 371 uword stack_buffer_[kStackBufferSizeInWords];
361 uword vm_tag_; 372 uword vm_tag_;
362 uword user_tag_; 373 uword user_tag_;
363 uword metadata_; 374 uword metadata_;
364 uword lr_; 375 uword lr_;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 private: 644 private:
634 ZoneGrowableArray<ProcessedSample*> samples_; 645 ZoneGrowableArray<ProcessedSample*> samples_;
635 CodeLookupTable* code_lookup_table_; 646 CodeLookupTable* code_lookup_table_;
636 647
637 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); 648 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer);
638 }; 649 };
639 650
640 } // namespace dart 651 } // namespace dart
641 652
642 #endif // VM_PROFILER_H_ 653 #endif // VM_PROFILER_H_
OLDNEW
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698