Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef INCLUDE_DART_TOOLS_API_H_ | 5 #ifndef INCLUDE_DART_TOOLS_API_H_ |
| 6 #define INCLUDE_DART_TOOLS_API_H_ | 6 #define INCLUDE_DART_TOOLS_API_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 /** \mainpage Dart Tools Embedding API Reference | 10 /** \mainpage Dart Tools Embedding API Reference |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 872 const char* event_kind, | 872 const char* event_kind, |
| 873 const uint8_t* bytes, | 873 const uint8_t* bytes, |
| 874 intptr_t bytes_length); | 874 intptr_t bytes_length); |
| 875 | 875 |
| 876 /* | 876 /* |
| 877 * ======== | 877 * ======== |
| 878 * Timeline | 878 * Timeline |
| 879 * ======== | 879 * ======== |
| 880 */ | 880 */ |
| 881 | 881 |
| 882 /** Timeline stream for Dart API calls */ | |
| 883 #define DART_TIMELINE_STREAM_API (1 << 0) | |
| 884 /** Timeline stream for compiler events */ | |
| 885 #define DART_TIMELINE_STREAM_COMPILER (1 << 1) | |
| 886 /** Timeline stream for embedder provided events */ | |
| 887 #define DART_TIMELINE_STREAM_EMBEDDER (1 << 2) | |
| 888 /** Timeline stream for GC events */ | |
| 889 #define DART_TIMELINE_STREAM_GC (1 << 3) | |
| 890 /** Timeline stream for isolate events */ | |
| 891 #define DART_TIMELINE_STREAM_ISOLATE (1 << 4) | |
| 892 | |
| 893 /** Enable all timeline stream recording */ | |
| 894 #define DART_TIMELINE_STREAM_ALL (DART_TIMELINE_STREAM_API | \ | |
| 895 DART_TIMELINE_STREAM_COMPILER | \ | |
| 896 DART_TIMELINE_STREAM_EMBEDDER | \ | |
| 897 DART_TIMELINE_STREAM_GC | \ | |
| 898 DART_TIMELINE_STREAM_ISOLATE) | |
| 899 | |
| 900 /** Disable all timeline stream recording */ | |
| 901 #define DART_TIMELINE_STREAM_DISABLE 0 | |
| 902 | |
| 903 /** | |
| 904 * Start recording timeline events for the current isolate. | |
| 905 * | |
| 906 * \param stream_mask A bitmask of streams that should be recorded. | |
| 907 * | |
| 908 * NOTE: Calling with 0 disables recording of all streams. | |
| 909 */ | |
| 910 DART_EXPORT void Dart_TimelineSetRecordedStreams(int64_t stream_mask); | |
| 911 | |
| 912 /** | |
| 913 * Get the timeline for the current isolate in trace-event format | |
|
turnidge
2015/08/10 20:21:25
If there is a convenient description of the trace-
Cutch
2015/08/10 20:38:16
Done.
| |
| 914 * | |
| 915 * \param output The address of the trace buffer output | |
| 916 * \param output_length The length of the trace buffer output | |
| 917 * | |
| 918 * NOTE: output is allocated in the C heap and must be freed by the caller. | |
| 919 * | |
| 920 * \return True if a trace was output. The outputted trace may be empty. | |
| 921 */ | |
| 922 DART_EXPORT bool Dart_TimelineGetTrace(const char** output, | |
| 923 intptr_t* output_length); | |
| 924 | |
| 882 /** | 925 /** |
| 883 * Add a duration timeline event to the embedder stream for the current isolate. | 926 * Add a duration timeline event to the embedder stream for the current isolate. |
| 884 * | 927 * |
| 885 * \param label The name of the event. | 928 * \param label The name of the event. |
| 886 * \param start_micros The start of the duration (in microseconds) | 929 * \param start_micros The start of the duration (in microseconds) |
| 887 * \param end_micros The end of the duration (in microseconds) | 930 * \param end_micros The end of the duration (in microseconds) |
| 888 * | 931 * |
| 889 * NOTE: On Posix platforms you should use gettimeofday and on Windows platforms | 932 * NOTE: On Posix platforms you should use gettimeofday and on Windows platforms |
| 890 * you should use GetSystemTimeAsFileTime to get the time values. | 933 * you should use GetSystemTimeAsFileTime to get the time values. |
| 891 */ | 934 */ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 949 * \return Returns an asynchronous id that must be passed to | 992 * \return Returns an asynchronous id that must be passed to |
| 950 * Dart_TimelineAsyncInstant and Dart_TimelineAsyncEnd. | 993 * Dart_TimelineAsyncInstant and Dart_TimelineAsyncEnd. |
| 951 * | 994 * |
| 952 * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms | 995 * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms |
| 953 * this call uses GetSystemTimeAsFileTime to get the current time. | 996 * this call uses GetSystemTimeAsFileTime to get the current time. |
| 954 */ | 997 */ |
| 955 DART_EXPORT Dart_Handle Dart_TimelineAsyncEnd(const char* label, | 998 DART_EXPORT Dart_Handle Dart_TimelineAsyncEnd(const char* label, |
| 956 int64_t async_id); | 999 int64_t async_id); |
| 957 | 1000 |
| 958 #endif // INCLUDE_DART_TOOLS_API_H_ | 1001 #endif // INCLUDE_DART_TOOLS_API_H_ |
| OLD | NEW |