LLVM  16.0.0git
MCPseudoProbe.h
Go to the documentation of this file.
1 //===- MCPseudoProbe.h - Pseudo probe encoding support ---------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the MCPseudoProbe to support the pseudo
10 // probe encoding for AutoFDO. Pseudo probes together with their inline context
11 // are encoded in a DFS recursive way in the .pseudoprobe sections. For each
12 // .pseudoprobe section, the encoded binary data consist of a single or mutiple
13 // function records each for one outlined function. A function record has the
14 // following format :
15 //
16 // FUNCTION BODY (one for each outlined function present in the text section)
17 // GUID (uint64)
18 // GUID of the function's source name which may be different from the
19 // actual binary linkage name. This GUID will be used to decode and
20 // generate a profile against the source function name.
21 // NPROBES (ULEB128)
22 // Number of probes originating from this function.
23 // NUM_INLINED_FUNCTIONS (ULEB128)
24 // Number of callees inlined into this function, aka number of
25 // first-level inlinees
26 // PROBE RECORDS
27 // A list of NPROBES entries. Each entry contains:
28 // INDEX (ULEB128)
29 // TYPE (uint4)
30 // 0 - block probe, 1 - indirect call, 2 - direct call
31 // ATTRIBUTE (uint3)
32 // 1 - reserved
33 // ADDRESS_TYPE (uint1)
34 // 0 - code address for regular probes (for downwards compatibility)
35 // - GUID of linkage name for sentinel probes
36 // 1 - address delta
37 // CODE_ADDRESS (uint64 or ULEB128)
38 // code address or address delta, depending on ADDRESS_TYPE
39 // INLINED FUNCTION RECORDS
40 // A list of NUM_INLINED_FUNCTIONS entries describing each of the inlined
41 // callees. Each record contains:
42 // INLINE SITE
43 // ID of the callsite probe (ULEB128)
44 // FUNCTION BODY
45 // A FUNCTION BODY entry describing the inlined function.
46 //
47 // TODO: retire the ADDRESS_TYPE encoding for code addresses once compatibility
48 // is no longer an issue.
49 //===----------------------------------------------------------------------===//
50 
51 #ifndef LLVM_MC_MCPSEUDOPROBE_H
52 #define LLVM_MC_MCPSEUDOPROBE_H
53 
54 #include "llvm/ADT/DenseSet.h"
55 #include "llvm/ADT/SmallVector.h"
56 #include "llvm/ADT/StringRef.h"
57 #include "llvm/IR/PseudoProbe.h"
58 #include "llvm/Support/ErrorOr.h"
59 #include <list>
60 #include <map>
61 #include <memory>
62 #include <string>
63 #include <tuple>
64 #include <type_traits>
65 #include <unordered_map>
66 #include <unordered_set>
67 #include <vector>
68 
69 namespace llvm {
70 
71 class MCSymbol;
72 class MCObjectStreamer;
73 class raw_ostream;
74 
75 enum class MCPseudoProbeFlag {
76  // If set, indicates that the probe is encoded as an address delta
77  // instead of a real code address.
78  AddressDelta = 0x1,
79 };
80 
81 // Function descriptor decoded from .pseudo_probe_desc section
85  std::string FuncName;
86 
88  : FuncGUID(GUID), FuncHash(Hash), FuncName(Name){};
89 
90  void print(raw_ostream &OS);
91 };
92 
93 class MCDecodedPseudoProbe;
94 
95 // An inline frame has the form <CalleeGuid, ProbeID>
96 using InlineSite = std::tuple<uint64_t, uint32_t>;
98 // GUID to PseudoProbeFuncDesc map
100  std::unordered_map<uint64_t, MCPseudoProbeFuncDesc>;
101 // Address to pseudo probes map.
102 using AddressProbesMap =
103  std::unordered_map<uint64_t, std::list<MCDecodedPseudoProbe>>;
104 
106 
108 protected:
111  uint8_t Attributes;
112  uint8_t Type;
113  // The value should be equal to PseudoProbeReservedId::Last + 1 which is
114  // defined in SampleProfileProbe.h. The header file is not included here to
115  // reduce the dependency from MC to IPO.
116  const static uint32_t PseudoProbeFirstId = 1;
117 
118 public:
120  : Guid(G), Index(I), Attributes(At), Type(T) {}
121 
122  bool isEntry() const { return Index == PseudoProbeFirstId; }
123 
124  uint64_t getGuid() const { return Guid; }
125 
126  uint64_t getIndex() const { return Index; }
127 
128  uint8_t getAttributes() const { return Attributes; }
129 
130  uint8_t getType() const { return Type; }
131 
132  bool isBlock() const {
133  return Type == static_cast<uint8_t>(PseudoProbeType::Block);
134  }
135 
136  bool isIndirectCall() const {
137  return Type == static_cast<uint8_t>(PseudoProbeType::IndirectCall);
138  }
139 
140  bool isDirectCall() const {
141  return Type == static_cast<uint8_t>(PseudoProbeType::DirectCall);
142  }
143 
144  bool isCall() const { return isIndirectCall() || isDirectCall(); }
145 
146  void setAttributes(uint8_t Attr) { Attributes = Attr; }
147 };
148 
149 /// Instances of this class represent a pseudo probe instance for a pseudo probe
150 /// table entry, which is created during a machine instruction is assembled and
151 /// uses an address from a temporary label created at the current address in the
152 /// current section.
154  MCSymbol *Label;
155 
156 public:
159  : MCPseudoProbeBase(Guid, Index, Attributes, Type), Label(Label) {
160  assert(Type <= 0xFF && "Probe type too big to encode, exceeding 2^8");
161  assert(Attributes <= 0xFF &&
162  "Probe attributes too big to encode, exceeding 2^16");
163  }
164 
165  MCSymbol *getLabel() const { return Label; }
166  void emit(MCObjectStreamer *MCOS, const MCPseudoProbe *LastProbe) const;
167 };
168 
169 // Represents a callsite with caller function name and probe id
170 using MCPseduoProbeFrameLocation = std::pair<StringRef, uint32_t>;
171 
173  uint64_t Address;
174  MCDecodedPseudoProbeInlineTree *InlineTree;
175 
176 public:
178  uint8_t At, MCDecodedPseudoProbeInlineTree *Tree)
179  : MCPseudoProbeBase(G, I, At, static_cast<uint8_t>(K)), Address(Ad),
180  InlineTree(Tree){};
181 
182  uint64_t getAddress() const { return Address; }
183 
184  void setAddress(uint64_t Addr) { Address = Addr; }
185 
187  return InlineTree;
188  }
189 
190  // Get the inlined context by traversing current inline tree backwards,
191  // each tree node has its InlineSite which is taken as the context.
192  // \p ContextStack is populated in root to leaf order
193  void
195  const GUIDProbeFunctionMap &GUID2FuncMAP) const;
196 
197  // Helper function to get the string from context stack
198  std::string
199  getInlineContextStr(const GUIDProbeFunctionMap &GUID2FuncMAP) const;
200 
201  // Print pseudo probe while disassembling
202  void print(raw_ostream &OS, const GUIDProbeFunctionMap &GUID2FuncMAP,
203  bool ShowName) const;
204 };
205 
206 template <typename ProbeType, typename DerivedProbeInlineTreeType>
208  struct InlineSiteHash {
209  uint64_t operator()(const InlineSite &Site) const {
210  return std::get<0>(Site) ^ std::get<1>(Site);
211  }
212  };
213 
214 protected:
215  // Track children (e.g. inlinees) of current context
216  using InlinedProbeTreeMap = std::unordered_map<
217  InlineSite, std::unique_ptr<DerivedProbeInlineTreeType>, InlineSiteHash>;
219  // Set of probes that come with the function.
220  std::vector<ProbeType> Probes;
222  static_assert(std::is_base_of<MCPseudoProbeInlineTreeBase,
223  DerivedProbeInlineTreeType>::value,
224  "DerivedProbeInlineTreeType must be subclass of "
225  "MCPseudoProbeInlineTreeBase");
226  }
227 
228 public:
230 
231  // Root node has a GUID 0.
232  bool isRoot() const { return Guid == 0; }
234  const InlinedProbeTreeMap &getChildren() const { return Children; }
235  std::vector<ProbeType> &getProbes() { return Probes; }
236  void addProbes(ProbeType Probe) { Probes.push_back(Probe); }
237  // Caller node of the inline site
239  DerivedProbeInlineTreeType *getOrAddNode(const InlineSite &Site) {
240  auto Ret = Children.emplace(
241  Site, std::make_unique<DerivedProbeInlineTreeType>(Site));
242  Ret.first->second->Parent = this;
243  return Ret.first->second.get();
244  };
245 };
246 
247 // A Tri-tree based data structure to group probes by inline stack.
248 // A tree is allocated for a standalone .text section. A fake
249 // instance is created as the root of a tree.
250 // A real instance of this class is created for each function, either a
251 // not inlined function that has code in .text section or an inlined function.
253  : public MCPseudoProbeInlineTreeBase<MCPseudoProbe,
254  MCPseudoProbeInlineTree> {
255 public:
256  MCPseudoProbeInlineTree() = default;
259  this->Guid = std::get<0>(Site);
260  }
261 
262  // MCPseudoProbeInlineTree method based on Inlinees
263  void addPseudoProbe(const MCPseudoProbe &Probe,
264  const MCPseudoProbeInlineStack &InlineStack);
265  void emit(MCObjectStreamer *MCOS, const MCPseudoProbe *&LastProbe);
266 };
267 
268 // inline tree node for the decoded pseudo probe
270  : public MCPseudoProbeInlineTreeBase<MCDecodedPseudoProbe *,
271  MCDecodedPseudoProbeInlineTree> {
272 public:
274  // Used for decoding
276 
277  MCDecodedPseudoProbeInlineTree() = default;
279 
280  // Return false if it's a dummy inline site
281  bool hasInlineSite() const { return !isRoot() && !Parent->isRoot(); }
282 };
283 
284 /// Instances of this class represent the pseudo probes inserted into a compile
285 /// unit.
287 public:
288  void addPseudoProbe(MCSymbol *FuncSym, const MCPseudoProbe &Probe,
289  const MCPseudoProbeInlineStack &InlineStack) {
290  MCProbeDivisions[FuncSym].addPseudoProbe(Probe, InlineStack);
291  }
292 
293  // TODO: Sort by getOrdinal to ensure a determinstic section order
294  using MCProbeDivisionMap = std::map<MCSymbol *, MCPseudoProbeInlineTree>;
295 
296 private:
297  // A collection of MCPseudoProbe for each function. The MCPseudoProbes are
298  // grouped by GUIDs due to inlining that can bring probes from different
299  // functions into one function.
300  MCProbeDivisionMap MCProbeDivisions;
301 
302 public:
303  const MCProbeDivisionMap &getMCProbes() const { return MCProbeDivisions; }
304 
305  bool empty() const { return MCProbeDivisions.empty(); }
306 
307  void emit(MCObjectStreamer *MCOS);
308 };
309 
311  // A collection of MCPseudoProbe in the current module grouped by
312  // functions. MCPseudoProbes will be encoded into a corresponding
313  // .pseudoprobe section. With functions emitted as separate comdats,
314  // a text section really only contains the code of a function solely, and the
315  // probes associated with the text section will be emitted into a standalone
316  // .pseudoprobe section that shares the same comdat group with the function.
317  MCPseudoProbeSections MCProbeSections;
318 
319 public:
320  static void emit(MCObjectStreamer *MCOS);
321 
322  MCPseudoProbeSections &getProbeSections() { return MCProbeSections; }
323 
324 #ifndef NDEBUG
325  static int DdgPrintIndent;
326 #endif
327 };
328 
330  // GUID to PseudoProbeFuncDesc map.
331  GUIDProbeFunctionMap GUID2FuncDescMap;
332 
333  // Address to probes map.
334  AddressProbesMap Address2ProbesMap;
335 
336  // The dummy root of the inline trie, all the outlined function will directly
337  // be the children of the dummy root, all the inlined function will be the
338  // children of its inlineer. So the relation would be like:
339  // DummyRoot --> OutlinedFunc --> InlinedFunc1 --> InlinedFunc2
340  MCDecodedPseudoProbeInlineTree DummyInlineRoot;
341 
342  /// Points to the current location in the buffer.
343  const uint8_t *Data = nullptr;
344 
345  /// Points to the end of the buffer.
346  const uint8_t *End = nullptr;
347 
348  /// Whether encoding is based on a starting probe with absolute code address.
349  bool EncodingIsAddrBased = false;
350 
351  // Decoding helper function
352  template <typename T> ErrorOr<T> readUnencodedNumber();
353  template <typename T> ErrorOr<T> readUnsignedNumber();
354  template <typename T> ErrorOr<T> readSignedNumber();
355  ErrorOr<StringRef> readString(uint32_t Size);
356 
357 public:
360 
361  // Decode pseudo_probe_desc section to build GUID to PseudoProbeFuncDesc map.
362  bool buildGUID2FuncDescMap(const uint8_t *Start, std::size_t Size);
363 
364  // Decode pseudo_probe section to build address to probes map for specifed
365  // functions only.
366  bool buildAddress2ProbeMap(const uint8_t *Start, std::size_t Size,
367  const Uint64Set &GuildFilter,
368  const Uint64Map &FuncStartAddrs);
369 
371  uint64_t &LastAddr, const Uint64Set &GuildFilter,
372  const Uint64Map &FuncStartAddrs);
373 
374  // Print pseudo_probe_desc section info
376 
377  // Print pseudo_probe section info, used along with show-disassembly
378  void printProbeForAddress(raw_ostream &OS, uint64_t Address);
379 
380  // do printProbeForAddress for all addresses
382 
383  // Look up the probe of a call for the input address
384  const MCDecodedPseudoProbe *getCallProbeForAddr(uint64_t Address) const;
385 
387 
388  // Helper function to populate one probe's inline stack into
389  // \p InlineContextStack.
390  // Current leaf location info will be added if IncludeLeaf is true
391  // Example:
392  // Current probe(bar:3) inlined at foo:2 then inlined at main:1
393  // IncludeLeaf = true, Output: [main:1, foo:2, bar:3]
394  // IncludeLeaf = false, Output: [main:1, foo:2]
396  const MCDecodedPseudoProbe *Probe,
398  bool IncludeLeaf) const;
399 
401  return Address2ProbesMap;
402  }
403 
404  AddressProbesMap &getAddress2ProbesMap() { return Address2ProbesMap; }
405 
407  return GUID2FuncDescMap;
408  }
409 
410  const MCPseudoProbeFuncDesc *
411  getInlinerDescForProbe(const MCDecodedPseudoProbe *Probe) const;
412 
414  return DummyInlineRoot;
415  }
416 };
417 
418 } // end namespace llvm
419 
420 #endif // LLVM_MC_MCPSEUDOPROBE_H
llvm::MCPseudoProbeSections::emit
void emit(MCObjectStreamer *MCOS)
Definition: MCPseudoProbe.cpp:202
llvm::MCDecodedPseudoProbe::MCDecodedPseudoProbe
MCDecodedPseudoProbe(uint64_t Ad, uint64_t G, uint32_t I, PseudoProbeType K, uint8_t At, MCDecodedPseudoProbeInlineTree *Tree)
Definition: MCPseudoProbe.h:177
llvm::GUIDProbeFunctionMap
std::unordered_map< uint64_t, MCPseudoProbeFuncDesc > GUIDProbeFunctionMap
Definition: MCPseudoProbe.h:100
llvm::MCPseudoProbeDecoder::printProbeForAddress
void printProbeForAddress(raw_ostream &OS, uint64_t Address)
Definition: MCPseudoProbe.cpp:535
llvm::AddressProbesMap
std::unordered_map< uint64_t, std::list< MCDecodedPseudoProbe > > AddressProbesMap
Definition: MCPseudoProbe.h:103
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::InlineSite
std::tuple< uint64_t, uint32_t > InlineSite
Definition: MCPseudoProbe.h:96
llvm::MCPseudoProbeBase::getType
uint8_t getType() const
Definition: MCPseudoProbe.h:130
llvm::MCDecodedPseudoProbe::print
void print(raw_ostream &OS, const GUIDProbeFunctionMap &GUID2FuncMAP, bool ShowName) const
Definition: MCPseudoProbe.cpp:302
StringRef.h
llvm::MCPseudoProbeBase::isCall
bool isCall() const
Definition: MCPseudoProbe.h:144
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1199
llvm::MCPseudoProbeInlineTree::MCPseudoProbeInlineTree
MCPseudoProbeInlineTree(const InlineSite &Site)
Definition: MCPseudoProbe.h:258
llvm::MCPseudoProbeBase::Index
uint64_t Index
Definition: MCPseudoProbe.h:110
llvm::MCPseudoProbeDecoder::getGUID2FuncDescMap
const GUIDProbeFunctionMap & getGUID2FuncDescMap() const
Definition: MCPseudoProbe.h:406
llvm::MCPseudoProbe
Instances of this class represent a pseudo probe instance for a pseudo probe table entry,...
Definition: MCPseudoProbe.h:153
llvm::MCPseudoProbeInlineTree::addPseudoProbe
void addPseudoProbe(const MCPseudoProbe &Probe, const MCPseudoProbeInlineStack &InlineStack)
Definition: MCPseudoProbe.cpp:90
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::MCPseudoProbeInlineTreeBase::getProbes
std::vector< ProbeType > & getProbes()
Definition: MCPseudoProbe.h:235
llvm::MCPseudoProbeInlineTree::MCPseudoProbeInlineTree
MCPseudoProbeInlineTree()=default
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::MCPseudoProbeSections::empty
bool empty() const
Definition: MCPseudoProbe.h:305
llvm::MipsISD::Ret
@ Ret
Definition: MipsISelLowering.h:119
llvm::MCPseudoProbeBase::getAttributes
uint8_t getAttributes() const
Definition: MCPseudoProbe.h:128
llvm::PseudoProbeType
PseudoProbeType
Definition: PseudoProbe.h:29
llvm::MCPseudoProbeDecoder::getAddress2ProbesMap
const AddressProbesMap & getAddress2ProbesMap() const
Definition: MCPseudoProbe.h:400
llvm::MCPseudoProbeInlineTreeBase::Probes
std::vector< ProbeType > Probes
Definition: MCPseudoProbe.h:220
llvm::MCPseudoProbeFuncDesc
Definition: MCPseudoProbe.h:82
llvm::PseudoProbeType::IndirectCall
@ IndirectCall
llvm::MCPseudoProbeInlineTreeBase::MCPseudoProbeInlineTreeBase
MCPseudoProbeInlineTreeBase()
Definition: MCPseudoProbe.h:221
llvm::MCDecodedPseudoProbeInlineTree::MCDecodedPseudoProbeInlineTree
MCDecodedPseudoProbeInlineTree(const InlineSite &Site)
Definition: MCPseudoProbe.h:278
llvm::MCPseudoProbeInlineTreeBase::isRoot
bool isRoot() const
Definition: MCPseudoProbe.h:232
llvm::MCPseudoProbeFuncDesc::print
void print(raw_ostream &OS)
Definition: MCPseudoProbe.cpp:264
llvm::MCDecodedPseudoProbeInlineTree::ISite
InlineSite ISite
Definition: MCPseudoProbe.h:273
llvm::MCDecodedPseudoProbe::getInlineTreeNode
MCDecodedPseudoProbeInlineTree * getInlineTreeNode() const
Definition: MCPseudoProbe.h:186
llvm::MCPseudoProbeInlineTreeBase::InlinedProbeTreeMap
std::unordered_map< InlineSite, std::unique_ptr< DerivedProbeInlineTreeType >, InlineSiteHash > InlinedProbeTreeMap
Definition: MCPseudoProbe.h:217
DenseSet.h
llvm::MCPseudoProbeBase
Definition: MCPseudoProbe.h:107
llvm::dwarf::Index
Index
Definition: Dwarf.h:472
llvm::MCObjectStreamer
Streaming object file generation interface.
Definition: MCObjectStreamer.h:42
llvm::MCPseudoProbeInlineTree::emit
void emit(MCObjectStreamer *MCOS, const MCPseudoProbe *&LastProbe)
Definition: MCPseudoProbe.cpp:133
llvm::MCPseudoProbeDecoder::getInlineContextForProbe
void getInlineContextForProbe(const MCDecodedPseudoProbe *Probe, SmallVectorImpl< MCPseduoProbeFrameLocation > &InlineContextStack, bool IncludeLeaf) const
Definition: MCPseudoProbe.cpp:585
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::MCPseudoProbeDecoder::buildGUID2FuncDescMap
bool buildGUID2FuncDescMap(const uint8_t *Start, std::size_t Size)
Definition: MCPseudoProbe.cpp:359
llvm::MCPseudoProbeInlineTreeBase::getOrAddNode
DerivedProbeInlineTreeType * getOrAddNode(const InlineSite &Site)
Definition: MCPseudoProbe.h:239
llvm::MCDecodedPseudoProbeInlineTree::ChildrenToProcess
uint32_t ChildrenToProcess
Definition: MCPseudoProbe.h:275
G
const DataFlowGraph & G
Definition: RDFGraph.cpp:200
llvm::DenseSet< uint64_t >
llvm::MCPseudoProbeBase::Attributes
uint8_t Attributes
Definition: MCPseudoProbe.h:111
llvm::MCPseudoProbeInlineTreeBase::getChildren
InlinedProbeTreeMap & getChildren()
Definition: MCPseudoProbe.h:233
llvm::MCPseudoProbeFuncDesc::FuncGUID
uint64_t FuncGUID
Definition: MCPseudoProbe.h:83
uint64_t
llvm::MCPseudoProbe::emit
void emit(MCObjectStreamer *MCOS, const MCPseudoProbe *LastProbe) const
Definition: MCPseudoProbe.cpp:49
llvm::MCPseudoProbeFlag
MCPseudoProbeFlag
Definition: MCPseudoProbe.h:75
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:79
llvm::MCPseudoProbeFuncDesc::FuncHash
uint64_t FuncHash
Definition: MCPseudoProbe.h:84
llvm::MCPseudoProbeBase::Type
uint8_t Type
Definition: MCPseudoProbe.h:112
llvm::MCPseudoProbeSections::addPseudoProbe
void addPseudoProbe(MCSymbol *FuncSym, const MCPseudoProbe &Probe, const MCPseudoProbeInlineStack &InlineStack)
Definition: MCPseudoProbe.h:288
llvm::DenseMap
Definition: DenseMap.h:714
ErrorOr.h
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::MCDecodedPseudoProbe::getAddress
uint64_t getAddress() const
Definition: MCPseudoProbe.h:182
llvm::MCPseudoProbeDecoder
Definition: MCPseudoProbe.h:329
llvm::MCPseudoProbeInlineTreeBase
Definition: MCPseudoProbe.h:207
llvm::MCPseudoProbeSections
Instances of this class represent the pseudo probes inserted into a compile unit.
Definition: MCPseudoProbe.h:286
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCPseudoProbe::getLabel
MCSymbol * getLabel() const
Definition: MCPseudoProbe.h:165
llvm::MCPseudoProbeFuncDesc::MCPseudoProbeFuncDesc
MCPseudoProbeFuncDesc(uint64_t GUID, uint64_t Hash, StringRef Name)
Definition: MCPseudoProbe.h:87
llvm::MCPseudoProbeBase::Guid
uint64_t Guid
Definition: MCPseudoProbe.h:109
llvm::MCPseudoProbeTable
Definition: MCPseudoProbe.h:310
llvm::MCPseudoProbeInlineTreeBase::Parent
MCPseudoProbeInlineTreeBase< ProbeType, DerivedProbeInlineTreeType > * Parent
Definition: MCPseudoProbe.h:238
llvm::MCPseudoProbeInlineTreeBase::Children
InlinedProbeTreeMap Children
Definition: MCPseudoProbe.h:218
llvm::MCDecodedPseudoProbe::getInlineContextStr
std::string getInlineContextStr(const GUIDProbeFunctionMap &GUID2FuncMAP) const
Definition: MCPseudoProbe.cpp:286
llvm::MCPseudoProbeFuncDesc::FuncName
std::string FuncName
Definition: MCPseudoProbe.h:85
llvm::MCPseudoProbeInlineTreeBase::getChildren
const InlinedProbeTreeMap & getChildren() const
Definition: MCPseudoProbe.h:234
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::MCPseudoProbeDecoder::printGUID2FuncDescMap
void printGUID2FuncDescMap(raw_ostream &OS)
Definition: MCPseudoProbe.cpp:525
llvm::MCPseudoProbeBase::PseudoProbeFirstId
const static uint32_t PseudoProbeFirstId
Definition: MCPseudoProbe.h:116
llvm::MCPseudoProbeInlineTree
Definition: MCPseudoProbe.h:252
uint32_t
llvm::MCPseudoProbeBase::isEntry
bool isEntry() const
Definition: MCPseudoProbe.h:122
llvm::MCPseudoProbeBase::MCPseudoProbeBase
MCPseudoProbeBase(uint64_t G, uint64_t I, uint64_t At, uint8_t T)
Definition: MCPseudoProbe.h:119
llvm::MCPseudoProbeInlineTreeBase::Guid
uint64_t Guid
Definition: MCPseudoProbe.h:229
llvm::MCPseudoProbeBase::isIndirectCall
bool isIndirectCall() const
Definition: MCPseudoProbe.h:136
llvm::MCPseudoProbeBase::getGuid
uint64_t getGuid() const
Definition: MCPseudoProbe.h:124
llvm::MCPseudoProbeDecoder::buildAddress2ProbeMap
bool buildAddress2ProbeMap(const uint8_t *Start, std::size_t Size, const Uint64Set &GuildFilter, const Uint64Map &FuncStartAddrs)
Definition: MCPseudoProbe.cpp:512
llvm::MCPseudoProbeInlineTreeBase::addProbes
void addProbes(ProbeType Probe)
Definition: MCPseudoProbe.h:236
llvm::MCPseudoProbeTable::DdgPrintIndent
static int DdgPrintIndent
Definition: MCPseudoProbe.h:325
llvm::MCDecodedPseudoProbeInlineTree::MCDecodedPseudoProbeInlineTree
MCDecodedPseudoProbeInlineTree()=default
llvm::MCPseudoProbeBase::getIndex
uint64_t getIndex() const
Definition: MCPseudoProbe.h:126
llvm::MCPseudoProbeDecoder::getDummyInlineRoot
const MCDecodedPseudoProbeInlineTree & getDummyInlineRoot() const
Definition: MCPseudoProbe.h:413
PseudoProbe.h
llvm::MCDecodedPseudoProbeInlineTree::hasInlineSite
bool hasInlineSite() const
Definition: MCPseudoProbe.h:281
llvm::MCPseudoProbeDecoder::getCallProbeForAddr
const MCDecodedPseudoProbe * getCallProbeForAddr(uint64_t Address) const
Definition: MCPseudoProbe.cpp:560
llvm::MCPseudoProbeBase::isDirectCall
bool isDirectCall() const
Definition: MCPseudoProbe.h:140
llvm::MCPseudoProbe::MCPseudoProbe
MCPseudoProbe(MCSymbol *Label, uint64_t Guid, uint64_t Index, uint64_t Type, uint64_t Attributes)
Definition: MCPseudoProbe.h:157
llvm::MCPseudoProbeFlag::AddressDelta
@ AddressDelta
llvm::MCPseudoProbeDecoder::printProbesForAllAddresses
void printProbesForAllAddresses(raw_ostream &OS)
Definition: MCPseudoProbe.cpp:546
llvm::PseudoProbeType::Block
@ Block
llvm::MCPseudoProbeDecoder::getFuncDescForGUID
const MCPseudoProbeFuncDesc * getFuncDescForGUID(uint64_t GUID) const
Definition: MCPseudoProbe.cpp:579
llvm::MCPseudoProbeSections::getMCProbes
const MCProbeDivisionMap & getMCProbes() const
Definition: MCPseudoProbe.h:303
SmallVector.h
llvm::MCDecodedPseudoProbeInlineTree
Definition: MCPseudoProbe.h:269
llvm::MCPseudoProbeSections::MCProbeDivisionMap
std::map< MCSymbol *, MCPseudoProbeInlineTree > MCProbeDivisionMap
Definition: MCPseudoProbe.h:294
llvm::ErrorOr
Represents either an error or a value T.
Definition: ErrorOr.h:56
llvm::MCDecodedPseudoProbe::setAddress
void setAddress(uint64_t Addr)
Definition: MCPseudoProbe.h:184
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
llvm::MCDecodedPseudoProbe
Definition: MCPseudoProbe.h:172
llvm::MCDecodedPseudoProbe::getInlineContext
void getInlineContext(SmallVectorImpl< MCPseduoProbeFrameLocation > &ContextStack, const GUIDProbeFunctionMap &GUID2FuncMAP) const
Definition: MCPseudoProbe.cpp:269
llvm::MCPseduoProbeFrameLocation
std::pair< StringRef, uint32_t > MCPseduoProbeFrameLocation
Definition: MCPseudoProbe.h:170
llvm::MCPseudoProbeDecoder::getInlinerDescForProbe
const MCPseudoProbeFuncDesc * getInlinerDescForProbe(const MCDecodedPseudoProbe *Probe) const
Definition: MCPseudoProbe.cpp:599
llvm::MCPseudoProbeTable::getProbeSections
MCPseudoProbeSections & getProbeSections()
Definition: MCPseudoProbe.h:322
llvm::MCPseudoProbeInlineTree::MCPseudoProbeInlineTree
MCPseudoProbeInlineTree(uint64_t Guid)
Definition: MCPseudoProbe.h:257
llvm::MCPseudoProbeDecoder::getAddress2ProbesMap
AddressProbesMap & getAddress2ProbesMap()
Definition: MCPseudoProbe.h:404
llvm::MCPseudoProbeBase::setAttributes
void setAttributes(uint8_t Attr)
Definition: MCPseudoProbe.h:146
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172
llvm::MCPseudoProbeBase::isBlock
bool isBlock() const
Definition: MCPseudoProbe.h:132
llvm::PseudoProbeType::DirectCall
@ DirectCall
llvm::MCPseudoProbeTable::emit
static void emit(MCObjectStreamer *MCOS)
Definition: MCPseudoProbe.cpp:240