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

Unified Diff: runtime/vm/heap.h

Issue 11734028: - Consolidate verbose-gc output to be a single line which can be imported easily into spreadsheets. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/heap.h
===================================================================
--- runtime/vm/heap.h (revision 16586)
+++ runtime/vm/heap.h (working copy)
@@ -43,7 +43,6 @@
kNewSpace,
kPromotionFailure,
kOldSpace,
- kCodeSpace,
kFull,
kGCAtAlloc,
kGCTestCase,
@@ -178,16 +177,66 @@
// Returns the number of objects with a peer.
int64_t PeerCount() const;
+ // Stats collection.
+ void RecordTime(int id, int64_t micros) {
+ ASSERT((id > 0) && (id < GCStats::kDataEntries));
siva 2013/01/04 01:40:12 This asserts here that id should be > 0 but I see
Ivan Posva 2013/01/04 02:14:31 Done.
+ stats_.times_[id] = micros;
+ }
+
+ void RecordData(int id, intptr_t value) {
+ ASSERT((id > 0) && (id < GCStats::kDataEntries));
siva 2013/01/04 01:40:12 This asserts here that id should be > 0 but I see
Ivan Posva 2013/01/04 02:14:31 Done.
Ivan Posva 2013/01/04 02:14:31 Done.
+ stats_.data_[id] = value;
+ }
+
private:
+ class GCStats : public ValueObject {
+ public:
+ GCStats() {}
+ intptr_t num_;
+ Heap::Space space_;
+ Heap::GCReason reason_;
+
+ class Data : public ValueObject {
+ public:
+ Data() {}
+ int64_t micros_;
+ intptr_t new_used_;
+ intptr_t new_capacity_;
+ intptr_t old_used_;
+ intptr_t old_capacity_;
+
+ DISALLOW_COPY_AND_ASSIGN(Data);
+ };
+
+ enum {
+ kDataEntries = 4
+ };
+
+ Data before_;
+ Data after_;
+ int64_t times_[kDataEntries];
+ intptr_t data_[kDataEntries];
+
+ DISALLOW_COPY_AND_ASSIGN(GCStats);
+ };
+
Heap();
uword AllocateNew(intptr_t size);
uword AllocateOld(intptr_t size, HeapPage::PageType type);
+ // GC stats collection.
+ void RecordBeforeGC(Space space, GCReason reason);
+ void RecordAfterGC();
+ void PrintStats();
+
// The different spaces used for allocation.
Scavenger* new_space_;
PageSpace* old_space_;
+ // GC stats collection.
+ GCStats stats_;
+
// The active heap trace.
HeapTrace* heap_trace_;
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/heap.cc » ('j') | runtime/vm/scavenger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698