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