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

Unified Diff: include/v8.h

Issue 159581: Add generic V8 API functions for controlling profiling aspects. (Closed)
Patch Set: Renamings Created 11 years, 5 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.h
diff --git a/include/v8.h b/include/v8.h
index 382131eedea9ef6cc6d89d9ae8f3be8a258a52d1..5e3dbffb68ce68058298308d5e72b280dda9d0d7 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1967,6 +1967,20 @@ typedef Persistent<Context> (*ContextGenerator)();
/**
+ * Profiler modules.
+ *
+ * In V8, profiler consists of several modules: CPU profiler, and different
+ * kinds of heap profiling. Each can be turned on / off independently.
+ */
+enum ProfilerModules {
+ PROFILER_MODULE_NONE = 0,
+ PROFILER_MODULE_CPU = 1,
+ PROFILER_MODULE_HEAP_STATS = 1 << 1,
+ PROFILER_MODULE_JS_CONSTRUCTORS = 1 << 2
+};
+
+
+/**
* Container class for static utility functions.
*/
class V8EXPORT V8 {
@@ -2120,6 +2134,32 @@ class V8EXPORT V8 {
static bool IsProfilerPaused();
/**
+ * Resumes specified profiler modules.
+ * "ResumeProfiler" is equivalent to "ResumeProfilerEx(PROFILER_MODULE_CPU)".
+ * See ProfilerModules enum.
+ *
+ * \param flags Flags specifying profiler modules.
+ */
+ static void ResumeProfilerEx(int flags);
+
+ /**
+ * Pauses specified profiler modules.
+ * "PauseProfiler" is equivalent to "PauseProfilerEx(PROFILER_MODULE_CPU)".
+ * See ProfilerModules enum.
+ *
+ * \param flags Flags specifying profiler modules.
+ */
+ static void PauseProfilerEx(int flags);
+
+ /**
+ * Returns active (resumed) profiler modules.
+ * See ProfilerModules enum.
+ *
+ * \returns active profiler modules.
+ */
+ static int GetActiveProfilerModules();
+
+ /**
* If logging is performed into a memory buffer (via --logfile=*), allows to
* retrieve previously written messages. This can be used for retrieving
* profiler log data in the application. This function is thread-safe.
« 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