Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
tags.h File Reference
#include "platform/growable_array.h"
#include "vm/allocation.h"
#include "vm/os_thread.h"
#include "vm/thread_stack_resource.h"

Go to the source code of this file.

Classes

class  dart::VMTag
 
class  dart::VMTagScope
 
class  dart::VMTagCounters
 
class  dart::UserTags
 

Namespaces

namespace  dart
 

Macros

#define VM_TAG_LIST(V)
 
#define DEFINE_VM_TAG_ID(tag)   k##tag##TagId,
 

Macro Definition Documentation

◆ DEFINE_VM_TAG_ID

#define DEFINE_VM_TAG_ID (   tag)    k##tag##TagId,

Definition at line 39 of file tags.h.

◆ VM_TAG_LIST

#define VM_TAG_LIST (   V)
Value:
V(Idle) /* isolate is idle and is_runnable() */ \
V(LoadWait) /* isolate is idle and !is_runnable() */ \
V(VM) /* Catch all */ \
V(CompileOptimized) \
V(CompileUnoptimized) \
V(ClassLoading) \
V(CompileParseRegExp) \
V(Dart) \
V(GCNewSpace) \
V(GCOldSpace) \
V(GCIdle) \
V(Embedder) \
V(Runtime) \
V(Native)
#define V(name)
Definition raw_object.h:124

Definition at line 19 of file tags.h.

34 : public AllStatic {
35 public:
36 enum VMTagId {
37 kInvalidTagId = 0,
38#define DEFINE_VM_TAG_ID(tag) k##tag##TagId,
40#undef DEFINE_VM_TAG_KIND
41 kNumVMTags,
42 //
43 // All tags below |kNumVMTags| are special meta-data tags and do not
44 // indicate the state of the VM during a sample.
45 //
46 kRootTagId, // Special tag used as root of all profiles.
47 kTruncatedTagId, // Special tag used to indicate a truncated call stack.
48 // Code transition tags (used by unit tests).
49 kNoneCodeTagId,
50 kOptimizedCodeTagId,
51 kUnoptimizedCodeTagId,
52 kNativeCodeTagId,
53 kInlineStartCodeTagId,
54 kInlineEndCodeTagId,
55 kLastTagId,
56 };
57
58 static bool IsVMTag(uword id) {
59 return (id != kInvalidTagId) && (id < kNumVMTags);
60 }
61 static const char* TagName(uword id);
62 static bool IsNativeEntryTag(uword id);
63 static bool IsDartTag(uword id) { return id == kDartTagId; }
64 static bool IsExitFrameTag(uword id);
65 static bool IsRuntimeEntryTag(uword id);
66 static const char* RuntimeEntryTagName(uword id);
67
68 static void RegisterRuntimeEntry(RuntimeEntry* runtime_entry);
69
70 private:
71 struct TagEntry {
72 const char* name;
73 uword id;
74 };
75 static const TagEntry entries_[];
76};
77
78class VMTagScope : ThreadStackResource {
79 public:
80 VMTagScope(Thread* thread, uword tag, bool conditional_set = true);
81 ~VMTagScope();
82
83 private:
84 uword previous_tag_;
85
88};
89
90class VMTagCounters {
91 public:
92 VMTagCounters();
93
94 void Increment(uword tag);
95
96 int64_t count(uword tag);
97
98#ifndef PRODUCT
99 void PrintToJSONObject(JSONObject* obj);
100#endif // !PRODUCT
101
102 private:
103 int64_t counters_[VMTag::kNumVMTags];
104};
105
106class UserTags : public AllStatic {
107 public:
108 // UserTag id space: [kUserTagIdOffset, kUserTagIdOffset + kMaxUserTags).
109 static constexpr intptr_t kMaxUserTags = 256;
110 static constexpr uword kUserTagIdOffset = 0x4096;
111 static constexpr uword kDefaultUserTag = kUserTagIdOffset;
112 static const char* TagName(uword tag_id);
113 static bool IsUserTag(uword tag_id) {
114 return (tag_id >= kUserTagIdOffset) &&
115 (tag_id < kUserTagIdOffset + kMaxUserTags);
116 }
117 static void AddStreamableTagName(const char* tag);
118 static void RemoveStreamableTagName(const char* tag);
119 static bool IsTagNameStreamable(const char* tag);
120 static void Init();
121 static void Cleanup();
122
123 private:
124 static Mutex* subscribed_tags_lock_;
125 static MallocGrowableArray<const char*> subscribed_tags_;
126};
127
128} // namespace dart
129
130#endif // RUNTIME_VM_TAGS_H_
int count
const char * name
Definition fuchsia.cc:50
void Init()
uintptr_t uword
Definition globals.h:501
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
Definition globals.h:593
#define DISALLOW_ALLOCATION()
Definition globals.h:604
#define VM_TAG_LIST(V)
Definition tags.h:19
#define DEFINE_VM_TAG_ID(tag)
Definition tags.h:39
const uintptr_t id