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

Unified Diff: include/v8-profiler.h

Issue 3124024: Heap profiler: allow returning aggregated snapshots via the new API. (Closed)
Patch Set: Comments addressed Created 10 years, 4 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/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8-profiler.h
diff --git a/include/v8-profiler.h b/include/v8-profiler.h
index 9e3cb873c6fa7e2d2c43c50de32f6669bab9e3fe..dd1b8caf7b52303f906ff7786024410ec4b904b6 100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -260,10 +260,17 @@ class V8EXPORT HeapGraphNode {
/**
* Returns node id. For the same heap object, the id remains the same
- * across all snapshots.
+ * across all snapshots. Not applicable to aggregated heap snapshots
+ * as they only contain aggregated instances.
*/
uint64_t GetId() const;
+ /**
+ * Returns the number of instances. Only applicable to aggregated
+ * heap snapshots.
+ */
+ int GetInstancesCount() const;
+
/** Returns node's own size, in bytes. */
int GetSelfSize() const;
@@ -313,6 +320,15 @@ class V8EXPORT HeapSnapshotsDiff {
*/
class V8EXPORT HeapSnapshot {
public:
+ enum Type {
+ kFull = 0, // Heap snapshot with all instances and references.
+ kAggregated = 1 // Snapshot doesn't contain individual heap entries,
+ //instead they are grouped by constructor name.
+ };
+
+ /** Returns heap snapshot type. */
+ Type GetType() const;
+
/** Returns heap snapshot UID (assigned by the profiler.) */
unsigned GetUid() const;
@@ -322,7 +338,10 @@ class V8EXPORT HeapSnapshot {
/** Returns the root node of the heap graph. */
const HeapGraphNode* GetRoot() const;
- /** Returns a diff between this snapshot and another one. */
+ /**
+ * Returns a diff between this snapshot and another one. Only snapshots
+ * of the same type can be compared.
+ */
const HeapSnapshotsDiff* CompareWith(const HeapSnapshot* snapshot) const;
};
@@ -341,8 +360,13 @@ class V8EXPORT HeapProfiler {
/** Returns a profile by uid. */
static const HeapSnapshot* FindSnapshot(unsigned uid);
- /** Takes a heap snapshot and returns it. Title may be an empty string. */
- static const HeapSnapshot* TakeSnapshot(Handle<String> title);
+ /**
+ * Takes a heap snapshot and returns it. Title may be an empty string.
+ * See HeapSnapshot::Type for types description.
+ */
+ static const HeapSnapshot* TakeSnapshot(
+ Handle<String> title,
+ HeapSnapshot::Type type = HeapSnapshot::kFull);
};
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698