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

Unified Diff: include/v8-profiler.h

Issue 12919002: Allow recording individual samples in addition to the aggregated CPU profiles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed indentation Created 7 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/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 90a3d4d41ca50cf21cfd8a35423105e00704ecf2..41fe8a19992a3a63a1fe829805e5a5d4e223ce46 100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -105,6 +105,9 @@ class V8EXPORT CpuProfileNode {
/** Returns function entry UID. */
unsigned GetCallUid() const;
+ /** Returns id of the node. The id is unique within the tree */
+ unsigned GetNodeId() const;
+
/** Returns child nodes count of the node. */
int GetChildrenCount() const;
@@ -131,6 +134,18 @@ class V8EXPORT CpuProfile {
const CpuProfileNode* GetTopDownRoot() const;
/**
+ * Returns number of samples recorded. The samples are not recorded unless
+ * |record_samples| parameter of CpuProfiler::StartProfiling is true.
+ */
+ int GetSamplesCount() const;
+
+ /**
+ * Returns profile node corresponding to the top frame the sample at
+ * the given index.
+ */
+ const CpuProfileNode* GetSample(int index) const;
+
+ /**
* Deletes the profile and removes it from CpuProfiler's list.
* All pointers to nodes previously returned become invalid.
* Profiles with the same uid but obtained using different
@@ -179,8 +194,11 @@ class V8EXPORT CpuProfiler {
* title are silently ignored. While collecting a profile, functions
* from all security contexts are included in it. The token-based
* filtering is only performed when querying for a profile.
+ *
+ * |record_samples| parameter controls whether individual samples should
+ * be recorded in addition to the aggregated tree.
*/
- static void StartProfiling(Handle<String> title);
+ static void StartProfiling(Handle<String> title, bool record_samples = false);
/**
* Stops collecting CPU profile with a given title and returns it.
« 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