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

Unified Diff: src/heap-snapshot-generator.h

Issue 1019813004: Save heap object tracking data in heap snapshot (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap-snapshot-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-snapshot-generator.h
diff --git a/src/heap-snapshot-generator.h b/src/heap-snapshot-generator.h
index 55d36ce946af66d4a1f6d9c94c2e72b0d724ac5a..ef71ce6ff174836bb2d2b83bad6175a9b19b79ca 100644
--- a/src/heap-snapshot-generator.h
+++ b/src/heap-snapshot-generator.h
@@ -194,6 +194,16 @@ class HeapSnapshot {
class HeapObjectsMap {
public:
+ struct TimeInterval {
+ explicit TimeInterval(SnapshotObjectId id)
+ : id(id), size(0), count(0), timestamp(base::TimeTicks::Now()) {}
+ SnapshotObjectId last_assigned_id() const { return id - kObjectIdStep; }
+ SnapshotObjectId id;
+ uint32_t size;
+ uint32_t count;
+ base::TimeTicks timestamp;
+ };
+
explicit HeapObjectsMap(Heap* heap);
Heap* heap() const { return heap_; }
@@ -210,6 +220,7 @@ class HeapObjectsMap {
void StopHeapObjectsTracking();
SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
+ const List<TimeInterval>& samples() const { return time_intervals_; }
size_t GetUsedMemorySize() const;
SnapshotObjectId GenerateId(v8::RetainedObjectInfo* info);
@@ -236,12 +247,6 @@ class HeapObjectsMap {
unsigned int size;
bool accessed;
};
- struct TimeInterval {
- explicit TimeInterval(SnapshotObjectId id) : id(id), size(0), count(0) { }
- SnapshotObjectId id;
- uint32_t size;
- uint32_t count;
- };
SnapshotObjectId next_id_;
HashMap entries_map_;
@@ -584,6 +589,7 @@ class HeapSnapshotJSONSerializer {
void SerializeTraceTree();
void SerializeTraceNode(AllocationTraceNode* node);
void SerializeTraceNodeInfos();
+ void SerializeSamples();
void SerializeString(const unsigned char* s);
void SerializeStrings();
« no previous file with comments | « no previous file | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698