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

Unified Diff: runtime/include/dart_api.h

Issue 11428067: Merge the Merlin heap tracing to top-of-trunk. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add yet another missing file Created 8 years 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/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index ad3fa48e85c212016d5040ee09607c7063403b36..2c09ed6697b1fb862922d0e44b34729bde4799fa 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -534,12 +534,17 @@ DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback(
// --- Heap Profiler ---
/**
- * A callback invoked by the heap profiler during profiling to write
- * data.
+ * A callback invoked by the VM to write to a specified stream.
+ * Used by the heap profiler and gc trace.
*/
-typedef void (*Dart_HeapProfileWriteCallback)(const void* data,
- intptr_t length,
- void* stream);
+typedef void (*Dart_FileWriteCallback)(const void* data,
+ intptr_t length,
+ void* stream);
+
+typedef void* (*Dart_FileOpenCallback)(const char* name);
+
+typedef void (*Dart_FileCloseCallback)(void* stream);
+
/**
* Generates a heap profile.
@@ -551,7 +556,7 @@ typedef void (*Dart_HeapProfileWriteCallback)(const void* data,
*
* \return Success if the heap profile is successful.
*/
-DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback,
+DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_FileWriteCallback callback,
void* stream);
// --- Initialization and Globals ---
@@ -2740,7 +2745,7 @@ DART_EXPORT Dart_Handle Dart_SetNativeResolver(
Dart_NativeEntryResolver resolver);
// TODO(turnidge): Rename to Dart_LibrarySetNativeResolver?
-// --- Profiling support ----
+// --- Profiling support ---
// External pprof support for gathering and dumping symbolic
// information that can be used for better profile reports for
@@ -2753,6 +2758,13 @@ typedef void (*Dart_FileWriterFunction)(const char* buffer, int64_t num_bytes);
// Support for generating symbol maps for use by the Linux perf tool.
DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function);
+// --- Heap tracing support ---
+
+DART_EXPORT void Dart_InitHeapTrace(Dart_FileOpenCallback open_function,
Ivan Posva 2012/12/04 16:32:52 Shouldn't we just register a general open, write a
cshapiro 2012/12/04 21:13:33 Sure, I can do that. I would like the streams for
+ Dart_FileWriteCallback write_function,
+ Dart_FileCloseCallback close_function,
+ const char* prefix);
+
// --- Peers ---
/**
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/vm/assembler_ia32.h » ('j') | runtime/vm/assembler_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698