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

Unified Diff: runtime/include/dart_tools_api.h

Issue 1367973004: Make timeline use the same clock source as mojo's tracing infrastructure (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_tools_api.h
diff --git a/runtime/include/dart_tools_api.h b/runtime/include/dart_tools_api.h
index 0ed7cd28aee08c958ee82f6d7630a9fbc155ba33..0e279e0daded57c2e9de5299ed0997edd9a18f85 100644
--- a/runtime/include/dart_tools_api.h
+++ b/runtime/include/dart_tools_api.h
@@ -879,6 +879,14 @@ DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id,
* ========
*/
+/**
+ * Returns a timestamp in microseconds. This timestamp is suitable for
+ * passing into the timeline system.
+ *
+ * \return A timestamp that can be passed to the timeline system.
+ */
+DART_EXPORT int64_t Dart_TimelineGetMicros();
+
/** Timeline stream for Dart API calls */
#define DART_TIMELINE_STREAM_API (1 << 0)
/** Timeline stream for compiler events */
@@ -976,7 +984,6 @@ typedef void (*Dart_StreamConsumer)(
DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer,
void* user_data);
-
/**
* Get the timeline for entire VM (including all isolates).
*
@@ -1000,8 +1007,7 @@ DART_EXPORT bool Dart_GlobalTimelineGetTrace(Dart_StreamConsumer consumer,
* \param start_micros The start of the duration (in microseconds)
* \param end_micros The end of the duration (in microseconds)
*
- * NOTE: On Posix platforms you should use gettimeofday and on Windows platforms
- * you should use GetSystemTimeAsFileTime to get the time values.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
*/
DART_EXPORT Dart_Handle Dart_TimelineDuration(const char* label,
int64_t start_micros,
@@ -1013,8 +1019,7 @@ DART_EXPORT Dart_Handle Dart_TimelineDuration(const char* label,
*
* \param label The name of event.
*
- * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms
- * this call uses GetSystemTimeAsFileTime to get the current time.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
*/
DART_EXPORT Dart_Handle Dart_TimelineInstant(const char* label);
@@ -1031,8 +1036,7 @@ DART_EXPORT Dart_Handle Dart_TimelineInstant(const char* label);
* calls to Dart_TimelineAsyncInstant and Dart_TimelineAsyncEnd will become
* no-ops.
*
- * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms
- * this call uses GetSystemTimeAsFileTime to get the current time.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
*/
DART_EXPORT Dart_Handle Dart_TimelineAsyncBegin(const char* label,
int64_t* async_id);
@@ -1047,8 +1051,7 @@ DART_EXPORT Dart_Handle Dart_TimelineAsyncBegin(const char* label,
* \return Returns an asynchronous id that must be passed to
* Dart_TimelineAsyncInstant and Dart_TimelineAsyncEnd.
*
- * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms
- * this call uses GetSystemTimeAsFileTime to get the current time.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
*/
DART_EXPORT Dart_Handle Dart_TimelineAsyncInstant(const char* label,
int64_t async_id);
@@ -1063,8 +1066,7 @@ DART_EXPORT Dart_Handle Dart_TimelineAsyncInstant(const char* label,
* \return Returns an asynchronous id that must be passed to
* Dart_TimelineAsyncInstant and Dart_TimelineAsyncEnd.
*
- * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms
- * this call uses GetSystemTimeAsFileTime to get the current time.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
*/
DART_EXPORT Dart_Handle Dart_TimelineAsyncEnd(const char* label,
int64_t async_id);
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698