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

Side by Side Diff: runtime/include/dart_tools_api.h

Issue 1851953002: Add API to set thread name (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 984
985 typedef enum { 985 typedef enum {
986 Dart_Timeline_Event_Begin, // Phase = 'B'. 986 Dart_Timeline_Event_Begin, // Phase = 'B'.
987 Dart_Timeline_Event_End, // Phase = 'E'. 987 Dart_Timeline_Event_End, // Phase = 'E'.
988 Dart_Timeline_Event_Instant, // Phase = 'i'. 988 Dart_Timeline_Event_Instant, // Phase = 'i'.
989 Dart_Timeline_Event_Duration, // Phase = 'X'. 989 Dart_Timeline_Event_Duration, // Phase = 'X'.
990 Dart_Timeline_Event_Async_Begin, // Phase = 'b'. 990 Dart_Timeline_Event_Async_Begin, // Phase = 'b'.
991 Dart_Timeline_Event_Async_End, // Phase = 'e'. 991 Dart_Timeline_Event_Async_End, // Phase = 'e'.
992 Dart_Timeline_Event_Async_Instant, // Phase = 'n'. 992 Dart_Timeline_Event_Async_Instant, // Phase = 'n'.
993 Dart_Timeline_Event_Counter, // Phase = 'C'. 993 Dart_Timeline_Event_Counter, // Phase = 'C'.
994 Dart_Timeline_Event_Metadata, // Phase = 'M'.
995 } Dart_Timeline_Event_Type; 994 } Dart_Timeline_Event_Type;
996 995
997 /** 996 /**
998 * Add a timeline event to the embedder stream. 997 * Add a timeline event to the embedder stream.
999 * 998 *
1000 * \param label The name of the evnet. 999 * \param label The name of the evnet.
1001 * \param timestamp0 The first timestamp of the event. 1000 * \param timestamp0 The first timestamp of the event.
1002 * \param timestamp1_or_async_id The second timestamp of the event or 1001 * \param timestamp1_or_async_id The second timestamp of the event or
1003 * the async id. 1002 * the async id.
1004 * \param argument_count The number of argument names and values. 1003 * \param argument_count The number of argument names and values.
1005 * \param argument_names An array of names of the arguments. 1004 * \param argument_names An array of names of the arguments.
1006 * \param argument_values An array of values of the arguments. 1005 * \param argument_values An array of values of the arguments.
1007 */ 1006 */
1008 DART_EXPORT void Dart_TimelineEvent(const char* label, 1007 DART_EXPORT void Dart_TimelineEvent(const char* label,
1009 int64_t timestamp0, 1008 int64_t timestamp0,
1010 int64_t timestamp1_or_async_id, 1009 int64_t timestamp1_or_async_id,
1011 Dart_Timeline_Event_Type type, 1010 Dart_Timeline_Event_Type type,
1012 intptr_t argument_count, 1011 intptr_t argument_count,
1013 const char** argument_names, 1012 const char** argument_names,
1014 const char** argument_values); 1013 const char** argument_values);
1015 1014
1016 /** 1015 /**
1016 * Associates a name with the current thread. This name will be used to name
1017 * threads in the timeline. Can only be called after a call to Dart_Initialize.
1018 *
1019 * \param name The name of the thread.
1020 */
1021 DART_EXPORT void Dart_SetThreadName(const char* name);
1022
1023 /**
1017 * Called by the VM to let the embedder know when to start recording into the 1024 * Called by the VM to let the embedder know when to start recording into the
1018 * timeline. Can be called from any thread. 1025 * timeline. Can be called from any thread.
1019 */ 1026 */
1020 typedef void (*Dart_EmbedderTimelineStartRecording)(); 1027 typedef void (*Dart_EmbedderTimelineStartRecording)();
1021 1028
1022 /** 1029 /**
1023 * Called by the VM to let the embedder know when to stop recording into the 1030 * Called by the VM to let the embedder know when to stop recording into the
1024 * timeline. Can be called from any thread. 1031 * timeline. Can be called from any thread.
1025 */ 1032 */
1026 typedef void (*Dart_EmbedderTimelineStopRecording)(); 1033 typedef void (*Dart_EmbedderTimelineStopRecording)();
1027 1034
1028 /** 1035 /**
1029 * Sets the embedder timeline callbacks. These callbacks are used by the VM 1036 * Sets the embedder timeline callbacks. These callbacks are used by the VM
1030 * to notify the embedder of timeline recording state changes. 1037 * to notify the embedder of timeline recording state changes.
1031 * 1038 *
1032 * \param start_recording See Dart_EmbedderTimelineStartRecording. 1039 * \param start_recording See Dart_EmbedderTimelineStartRecording.
1033 * \param stop_recording See Dart_EmbedderTimelineStopRecording. 1040 * \param stop_recording See Dart_EmbedderTimelineStopRecording.
1034 * 1041 *
1035 * NOTE: To avoid races, this should be called before Dart_Initialize. 1042 * NOTE: To avoid races, this should be called before Dart_Initialize.
1036 */ 1043 */
1037 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks( 1044 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks(
1038 Dart_EmbedderTimelineStartRecording start_recording, 1045 Dart_EmbedderTimelineStartRecording start_recording,
1039 Dart_EmbedderTimelineStopRecording stop_recording); 1046 Dart_EmbedderTimelineStopRecording stop_recording);
1040 1047
1041 #endif // INCLUDE_DART_TOOLS_API_H_ 1048 #endif // INCLUDE_DART_TOOLS_API_H_
OLDNEW
« 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