LLVM: include/llvm/XRay/Profile.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_XRAY_PROFILE_H
14#define LLVM_XRAY_PROFILE_H
15
21#include
22#include
23#include
24
26
28
29
31
32
33
34
35
36
38
39
40
42
43
44
46
47
49
50
52public:
56
61
64 std::vector<std::pair<PathID, Data>> PathData;
65 };
66
67
68
69
70
72
73
74
76
77
78
79
80
81
82
84
87
89 : Blocks(std::move(O.Blocks)), NodeStorage(std::move(O.NodeStorage)),
90 Roots(std::move(O.Roots)), PathIDMap(std::move(O.PathIDMap)),
91 NextID(O.NextID) {}
92
94 Blocks = std::move(O.Blocks);
95 NodeStorage = std::move(O.NodeStorage);
96 Roots = std::move(O.Roots);
97 PathIDMap = std::move(O.PathIDMap);
98 NextID = O.NextID;
99 return *this;
100 }
101
104
107 swap(L.Blocks, R.Blocks);
108 swap(L.NodeStorage, R.NodeStorage);
109 swap(L.Roots, R.Roots);
110 swap(L.PathIDMap, R.PathIDMap);
111 swap(L.NextID, R.NextID);
112 }
113
114private:
115 using BlockList = std::list;
116
117 struct TrieNode {
119 std::vector<TrieNode *> Callees{};
120 TrieNode *Caller = nullptr;
122 };
123
124
125 BlockList Blocks;
126
127
128 std::list NodeStorage;
129
130
131 SmallVector<TrieNode *, 4> Roots;
132
133
134 DenseMap<PathID, TrieNode *> PathIDMap;
135
136
138
139public:
143 bool empty() const { return Blocks.empty(); }
144};
145
146}
147
148#endif
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines the DenseMap class.
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Profile instances are thread-compatible.
Definition Profile.h:51
uint64_t ThreadID
Definition Profile.h:53
Profile & operator=(Profile &&O) noexcept
Definition Profile.h:93
BlockList::const_iterator const_iterator
Definition Profile.h:140
const_iterator end() const
Definition Profile.h:142
unsigned PathID
Definition Profile.h:54
LLVM_ABI PathID internPath(ArrayRef< FuncID > P)
The stack represented in |P| must be in stack order (leaf to root).
friend void swap(Profile &L, Profile &R)
Definition Profile.h:105
LLVM_ABI Expected< std::vector< FuncID > > expandPath(PathID P) const
Provides a sequence of function IDs from a previously interned PathID.
Profile(Profile &&O) noexcept
Definition Profile.h:88
int32_t FuncID
Definition Profile.h:55
const_iterator begin() const
Definition Profile.h:141
bool empty() const
Definition Profile.h:143
LLVM_ABI Error addBlock(Block &&B)
Appends a fully-formed Block instance into the Profile.
A Trace object represents the records that have been loaded from XRay log files generated by instrume...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
LLVM_ABI Profile mergeProfilesByStack(const Profile &L, const Profile &R)
This algorithm will merge two Profile instances into a single Profile instance, aggregating blocks by...
LLVM_ABI Expected< Profile > profileFromTrace(const Trace &T)
This function takes a Trace and creates a Profile instance from it.
LLVM_ABI Expected< Profile > loadProfile(StringRef Filename)
This function will attempt to load an XRay Profiling Mode profile from the provided |Filename|.
LLVM_ABI Profile mergeProfilesByThread(const Profile &L, const Profile &R)
This algorithm will merge two Profile instances into a single Profile instance, aggregating blocks by...
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
ThreadID Thread
Definition Profile.h:63
std::vector< std::pair< PathID, Data > > PathData
Definition Profile.h:64
uint64_t CumulativeLocalTime
Definition Profile.h:59
uint64_t CallCount
Definition Profile.h:58