LLVM  14.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/MapVector.h"
48 #include "llvm/ADT/StringRef.h"
49 #include "llvm/ADT/Twine.h"
50 #include "llvm/IR/PseudoProbe.h"
51 #include "llvm/MC/MCSection.h"
52 #include "llvm/Support/Errc.h"
53 #include "llvm/Support/Error.h"
54 #include "llvm/Support/ErrorOr.h"
55 #include "llvm/Support/WithColor.h"
57 #include <algorithm>
58 #include <functional>
59 #include <list>
60 #include <map>
61 #include <set>
62 #include <sstream>
63 #include <string>
64 #include <system_error>
65 #include <unordered_map>
66 #include <unordered_set>
67 #include <vector>
68 
69 namespace llvm {
70 
71 class MCStreamer;
72 class MCSymbol;
73 class MCObjectStreamer;
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 MCPseudoProbe;
94 class MCDecodedPseudoProbe;
95 
96 // An inline frame has the form <Guid, ProbeID>
97 using InlineSite = std::tuple<uint64_t, uint32_t>;
99 // GUID to PseudoProbeFuncDesc map
100 using GUIDProbeFunctionMap =
101  std::unordered_map<uint64_t, MCPseudoProbeFuncDesc>;
102 // Address to pseudo probes map.
103 using AddressProbesMap =
104  std::unordered_map<uint64_t, std::list<MCDecodedPseudoProbe>>;
105 
108 
110 protected:
113  uint8_t Attributes;
114  uint8_t Type;
115  // The value should be equal to PseudoProbeReservedId::Last + 1 which is
116  // defined in SampleProfileProbe.h. The header file is not included here to
117  // reduce the dependency from MC to IPO.
118  const static uint32_t PseudoProbeFirstId = 1;
119 
120 public:
122  : Guid(G), Index(I), Attributes(At), Type(T) {}
123 
124  bool isEntry() const { return Index == PseudoProbeFirstId; }
125 
126  uint64_t getGuid() const { return Guid; }
127 
128  uint64_t getIndex() const { return Index; }
129 
130  uint8_t getAttributes() const { return Attributes; }
131 
132  uint8_t getType() const { return Type; }
133 
134  bool isBlock() const {
135  return Type == static_cast<uint8_t>(PseudoProbeType::Block);
136  }
137 
138  bool isIndirectCall() const {
139  return Type == static_cast<uint8_t>(PseudoProbeType::IndirectCall);
140  }
141 
142  bool isDirectCall() const {
143  return Type == static_cast<uint8_t>(PseudoProbeType::DirectCall);
144  }
145 
146  bool isCall() const { return isIndirectCall() || isDirectCall(); }
147 
148  void setAttributes(uint8_t Attr) { Attributes = Attr; }
149 };
150 
151 /// Instances of this class represent a pseudo probe instance for a pseudo probe
152 /// table entry, which is created during a machine instruction is assembled and
153 /// uses an address from a temporary label created at the current address in the
154 /// current section.
156  MCSymbol *Label;
157 
158 public:
161  : MCPseudoProbeBase(Guid, Index, Attributes, Type), Label(Label) {
162  assert(Type <= 0xFF && "Probe type too big to encode, exceeding 2^8");
163  assert(Attributes <= 0xFF &&
164  "Probe attributes too big to encode, exceeding 2^16");
165  }
166 
167  MCSymbol *getLabel() const { return Label; }
168  void emit(MCObjectStreamer *MCOS, const MCPseudoProbe *LastProbe) const;
169 };
170 
171 // Represents a callsite with caller function name and probe id
172 using MCPseduoProbeFrameLocation = std::pair<StringRef, uint32_t>;
173 
175  uint64_t Address;
176  MCDecodedPseudoProbeInlineTree *InlineTree;
177 
178 public:
180  uint8_t At, MCDecodedPseudoProbeInlineTree *Tree)
181  : MCPseudoProbeBase(G, I, At, static_cast<uint8_t>(K)), Address(Ad),
182  InlineTree(Tree){};
183 
184  uint64_t getAddress() const { return Address; }
185 
187 
189  return InlineTree;
190  }
191 
192  // Get the inlined context by traversing current inline tree backwards,
193  // each tree node has its InlineSite which is taken as the context.
194  // \p ContextStack is populated in root to leaf order
195  void
197  const GUIDProbeFunctionMap &GUID2FuncMAP) const;
198 
199  // Helper function to get the string from context stack
200  std::string
201  getInlineContextStr(const GUIDProbeFunctionMap &GUID2FuncMAP) const;
202 
203  // Print pseudo probe while disassembling
204  void print(raw_ostream &OS, const GUIDProbeFunctionMap &GUID2FuncMAP,
205  bool ShowName) const;
206 };
207 
208 template <typename ProbeType, typename DerivedProbeInlineTreeType>
210  struct InlineSiteHash {
211  uint64_t operator()(const InlineSite &Site) const {
212  return std::get<0>(Site) ^ std::get<1>(Site);
213  }
214  };
215 
216 protected:
217  // Track children (e.g. inlinees) of current context
218  using InlinedProbeTreeMap = std::unordered_map<
219  InlineSite, std::unique_ptr<DerivedProbeInlineTreeType>, InlineSiteHash>;
221  // Set of probes that come with the function.
222  std::vector<ProbeType> Probes;
224  static_assert(std::is_base_of<MCPseudoProbeInlineTreeBase,
225  DerivedProbeInlineTreeType>::value,
226  "DerivedProbeInlineTreeType must be subclass of "
227  "MCPseudoProbeInlineTreeBase");
228  }
229 
230 public:
232 
233  // Root node has a GUID 0.
234  bool isRoot() const { return Guid == 0; }
236  const InlinedProbeTreeMap &getChildren() const { return Children; }
237  std::vector<ProbeType> &getProbes() { return Probes; }
238  void addProbes(ProbeType Probe) { Probes.push_back(Probe); }
239  // Caller node of the inline site
241  DerivedProbeInlineTreeType *getOrAddNode(const InlineSite &Site) {
242  auto Ret = Children.emplace(
243  Site, std::make_unique<DerivedProbeInlineTreeType>(Site));
244  Ret.first->second->Parent = this;
245  return Ret.first->second.get();
246  };
247 };
248 
249 // A Tri-tree based data structure to group probes by inline stack.
250 // A tree is allocated for a standalone .text section. A fake
251 // instance is created as the root of a tree.
252 // A real instance of this class is created for each function, either a
253 // not inlined function that has code in .text section or an inlined function.
255  : public MCPseudoProbeInlineTreeBase<MCPseudoProbe,
256  MCPseudoProbeInlineTree> {
257 public:
258  MCPseudoProbeInlineTree() = default;
261  this->Guid = std::get<0>(Site);
262  }
263 
264  // MCPseudoProbeInlineTree method based on Inlinees
265  void addPseudoProbe(const MCPseudoProbe &Probe,
266  const MCPseudoProbeInlineStack &InlineStack);
267  void emit(MCObjectStreamer *MCOS, const MCPseudoProbe *&LastProbe);
268 };
269 
270 // inline tree node for the decoded pseudo probe
272  : public MCPseudoProbeInlineTreeBase<MCDecodedPseudoProbe *,
273  MCDecodedPseudoProbeInlineTree> {
274 public:
276  // Used for decoding
278 
281 
282  // Return false if it's a dummy inline site
283  bool hasInlineSite() const { return std::get<0>(ISite) != 0; }
284 };
285 
286 /// Instances of this class represent the pseudo probes inserted into a compile
287 /// unit.
289 public:
290  void addPseudoProbe(MCSection *Sec, const MCPseudoProbe &Probe,
291  const MCPseudoProbeInlineStack &InlineStack) {
292  MCProbeDivisions[Sec].addPseudoProbe(Probe, InlineStack);
293  }
294 
295  // TODO: Sort by getOrdinal to ensure a determinstic section order
296  using MCProbeDivisionMap = std::map<MCSection *, MCPseudoProbeInlineTree>;
297 
298 private:
299  // A collection of MCPseudoProbe for each text section. The MCPseudoProbes
300  // are grouped by GUID of the functions where they are from and will be
301  // encoded by groups. In the comdat scenario where a text section really only
302  // contains the code of a function solely, the probes associated with a comdat
303  // function are still grouped by GUIDs due to inlining that can bring probes
304  // from different functions into one function.
305  MCProbeDivisionMap MCProbeDivisions;
306 
307 public:
308  const MCProbeDivisionMap &getMCProbes() const { return MCProbeDivisions; }
309 
310  bool empty() const { return MCProbeDivisions.empty(); }
311 
312  void emit(MCObjectStreamer *MCOS);
313 };
314 
316  // A collection of MCPseudoProbe in the current module grouped by text
317  // sections. MCPseudoProbes will be encoded into a corresponding
318  // .pseudoprobe section. With functions emitted as separate comdats,
319  // a text section really only contains the code of a function solely, and the
320  // probes associated with the text section will be emitted into a standalone
321  // .pseudoprobe section that shares the same comdat group with the function.
322  MCPseudoProbeSection MCProbeSections;
323 
324 public:
325  static void emit(MCObjectStreamer *MCOS);
326 
327  MCPseudoProbeSection &getProbeSections() { return MCProbeSections; }
328 
329 #ifndef NDEBUG
330  static int DdgPrintIndent;
331 #endif
332 };
333 
335  // GUID to PseudoProbeFuncDesc map.
336  GUIDProbeFunctionMap GUID2FuncDescMap;
337 
338  // Address to probes map.
339  AddressProbesMap Address2ProbesMap;
340 
341  // The dummy root of the inline trie, all the outlined function will directly
342  // be the children of the dummy root, all the inlined function will be the
343  // children of its inlineer. So the relation would be like:
344  // DummyRoot --> OutlinedFunc --> InlinedFunc1 --> InlinedFunc2
345  MCDecodedPseudoProbeInlineTree DummyInlineRoot;
346 
347  /// Points to the current location in the buffer.
348  const uint8_t *Data = nullptr;
349 
350  /// Points to the end of the buffer.
351  const uint8_t *End = nullptr;
352 
353  // Decoding helper function
354  template <typename T> ErrorOr<T> readUnencodedNumber();
355  template <typename T> ErrorOr<T> readUnsignedNumber();
356  template <typename T> ErrorOr<T> readSignedNumber();
357  ErrorOr<StringRef> readString(uint32_t Size);
358 
359 public:
360  // Decode pseudo_probe_desc section to build GUID to PseudoProbeFuncDesc map.
361  bool buildGUID2FuncDescMap(const uint8_t *Start, std::size_t Size);
362 
363  // Decode pseudo_probe section to build address to probes map.
364  bool buildAddress2ProbeMap(const uint8_t *Start, std::size_t Size);
365 
366  // Print pseudo_probe_desc section info
368 
369  // Print pseudo_probe section info, used along with show-disassembly
371 
372  // do printProbeForAddress for all addresses
374 
375  // Look up the probe of a call for the input address
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::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::MCDecodedPseudoProbe::MCDecodedPseudoProbe
MCDecodedPseudoProbe(uint64_t Ad, uint64_t G, uint32_t I, PseudoProbeType K, uint8_t At, MCDecodedPseudoProbeInlineTree *Tree)
Definition: MCPseudoProbe.h:179
llvm::GUIDProbeFunctionMap
std::unordered_map< uint64_t, MCPseudoProbeFuncDesc > GUIDProbeFunctionMap
Definition: MCPseudoProbe.h:101
llvm::MCPseudoProbeDecoder::printProbeForAddress
void printProbeForAddress(raw_ostream &OS, uint64_t Address)
Definition: MCPseudoProbe.cpp:496
llvm::MCPseudoProbeSection
Instances of this class represent the pseudo probes inserted into a compile unit.
Definition: MCPseudoProbe.h:288
llvm::AddressProbesMap
std::unordered_map< uint64_t, std::list< MCDecodedPseudoProbe > > AddressProbesMap
Definition: MCPseudoProbe.h:104
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
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:97
llvm::MCPseudoProbeBase::getType
uint8_t getType() const
Definition: MCPseudoProbe.h:132
llvm::MCDecodedPseudoProbe::print
void print(raw_ostream &OS, const GUIDProbeFunctionMap &GUID2FuncMAP, bool ShowName) const
Definition: MCPseudoProbe.cpp:257
StringRef.h
llvm::MCPseudoProbeBase::isCall
bool isCall() const
Definition: MCPseudoProbe.h:146
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::MCPseudoProbeInlineTree::MCPseudoProbeInlineTree
MCPseudoProbeInlineTree(const InlineSite &Site)
Definition: MCPseudoProbe.h:260
llvm::MCPseudoProbeBase::Index
uint64_t Index
Definition: MCPseudoProbe.h:112
llvm::MCPseudoProbeSection::emit
void emit(MCObjectStreamer *MCOS)
Definition: MCPseudoProbe.cpp:176
MapVector.h
llvm::MCPseudoProbeDecoder::getGUID2FuncDescMap
const GUIDProbeFunctionMap & getGUID2FuncDescMap() const
Definition: MCPseudoProbe.h:398
Error.h
llvm::MCPseudoProbe
Instances of this class represent a pseudo probe instance for a pseudo probe table entry,...
Definition: MCPseudoProbe.h:155
llvm::MCPseudoProbeInlineTree::addPseudoProbe
void addPseudoProbe(const MCPseudoProbe &Probe, const MCPseudoProbeInlineStack &InlineStack)
Definition: MCPseudoProbe.cpp:78
Errc.h
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:237
llvm::MCPseudoProbeInlineTree::MCPseudoProbeInlineTree
MCPseudoProbeInlineTree()=default
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::MipsISD::Ret
@ Ret
Definition: MipsISelLowering.h:116
llvm::MCPseudoProbeBase::getAttributes
uint8_t getAttributes() const
Definition: MCPseudoProbe.h:130
llvm::PseudoProbeType
PseudoProbeType
Definition: PseudoProbe.h:28
llvm::MCPseudoProbeDecoder::getAddress2ProbesMap
const AddressProbesMap & getAddress2ProbesMap() const
Definition: MCPseudoProbe.h:392
llvm::MCPseudoProbeInlineTreeBase::Probes
std::vector< ProbeType > Probes
Definition: MCPseudoProbe.h:222
llvm::MCPseudoProbeFuncDesc
Definition: MCPseudoProbe.h:82
llvm::PseudoProbeType::IndirectCall
@ IndirectCall
llvm::MCPseudoProbeInlineTreeBase::MCPseudoProbeInlineTreeBase
MCPseudoProbeInlineTreeBase()
Definition: MCPseudoProbe.h:223
llvm::MCDecodedPseudoProbeInlineTree::MCDecodedPseudoProbeInlineTree
MCDecodedPseudoProbeInlineTree(const InlineSite &Site)
Definition: MCPseudoProbe.h:280
llvm::MCPseudoProbeTable::getProbeSections
MCPseudoProbeSection & getProbeSections()
Definition: MCPseudoProbe.h:327
llvm::MCPseudoProbeInlineTreeBase::isRoot
bool isRoot() const
Definition: MCPseudoProbe.h:234
llvm::MCPseudoProbeFuncDesc::print
void print(raw_ostream &OS)
Definition: MCPseudoProbe.cpp:218
llvm::MCDecodedPseudoProbeInlineTree::ISite
InlineSite ISite
Definition: MCPseudoProbe.h:275
llvm::MCDecodedPseudoProbe::getInlineTreeNode
MCDecodedPseudoProbeInlineTree * getInlineTreeNode() const
Definition: MCPseudoProbe.h:188
Twine.h
llvm::MCPseudoProbeInlineTreeBase::InlinedProbeTreeMap
std::unordered_map< InlineSite, std::unique_ptr< DerivedProbeInlineTreeType >, InlineSiteHash > InlinedProbeTreeMap
Definition: MCPseudoProbe.h:219
llvm::MCPseudoProbeBase
Definition: MCPseudoProbe.h:109
llvm::MCObjectStreamer
Streaming object file generation interface.
Definition: MCObjectStreamer.h:36
llvm::MCPseudoProbeSection::MCProbeDivisionMap
std::map< MCSection *, MCPseudoProbeInlineTree > MCProbeDivisionMap
Definition: MCPseudoProbe.h:296
llvm::MCPseudoProbeInlineTree::emit
void emit(MCObjectStreamer *MCOS, const MCPseudoProbe *&LastProbe)
Definition: MCPseudoProbe.cpp:121
llvm::MCPseudoProbeDecoder::getInlineContextForProbe
void getInlineContextForProbe(const MCDecodedPseudoProbe *Probe, SmallVectorImpl< MCPseduoProbeFrameLocation > &InlineContextStack, bool IncludeLeaf) const
Definition: MCPseudoProbe.cpp:546
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:314
llvm::MCPseudoProbeInlineTreeBase::getOrAddNode
DerivedProbeInlineTreeType * getOrAddNode(const InlineSite &Site)
Definition: MCPseudoProbe.h:241
llvm::MCDecodedPseudoProbeInlineTree::ChildrenToProcess
uint32_t ChildrenToProcess
Definition: MCPseudoProbe.h:277
G
const DataFlowGraph & G
Definition: RDFGraph.cpp:202
llvm::MCPseudoProbeBase::Attributes
uint8_t Attributes
Definition: MCPseudoProbe.h:113
llvm::MCPseudoProbeInlineTreeBase::getChildren
InlinedProbeTreeMap & getChildren()
Definition: MCPseudoProbe.h:235
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:41
llvm::MCPseudoProbeDecoder::buildAddress2ProbeMap
bool buildAddress2ProbeMap(const uint8_t *Start, std::size_t Size)
Definition: MCPseudoProbe.cpp:359
llvm::MCPseudoProbeFlag
MCPseudoProbeFlag
Definition: MCPseudoProbe.h:75
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:80
llvm::MCPseudoProbeFuncDesc::FuncHash
uint64_t FuncHash
Definition: MCPseudoProbe.h:84
llvm::MCPseudoProbeBase::Type
uint8_t Type
Definition: MCPseudoProbe.h:114
ErrorOr.h
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::MCDecodedPseudoProbe::getAddress
uint64_t getAddress() const
Definition: MCPseudoProbe.h:184
llvm::MCPseudoProbeDecoder
Definition: MCPseudoProbe.h:334
llvm::MCPseudoProbeInlineTreeBase
Definition: MCPseudoProbe.h:209
llvm::MCPseudoProbeSection::getMCProbes
const MCProbeDivisionMap & getMCProbes() const
Definition: MCPseudoProbe.h:308
llvm::HighlightColor::Address
@ Address
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCPseudoProbe::getLabel
MCSymbol * getLabel() const
Definition: MCPseudoProbe.h:167
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:111
llvm::MCPseudoProbeTable
Definition: MCPseudoProbe.h:315
llvm::MCPseudoProbeInlineTreeBase::Parent
MCPseudoProbeInlineTreeBase< ProbeType, DerivedProbeInlineTreeType > * Parent
Definition: MCPseudoProbe.h:240
llvm::MCPseudoProbeInlineTreeBase::Children
InlinedProbeTreeMap Children
Definition: MCPseudoProbe.h:220
MCSection.h
llvm::MCDecodedPseudoProbe::getInlineContextStr
std::string getInlineContextStr(const GUIDProbeFunctionMap &GUID2FuncMAP) const
Definition: MCPseudoProbe.cpp:241
llvm::MCPseudoProbeFuncDesc::FuncName
std::string FuncName
Definition: MCPseudoProbe.h:85
llvm::MCPseudoProbeInlineTreeBase::getChildren
const InlinedProbeTreeMap & getChildren() const
Definition: MCPseudoProbe.h:236
llvm::MCPseudoProbeSection::addPseudoProbe
void addPseudoProbe(MCSection *Sec, const MCPseudoProbe &Probe, const MCPseudoProbeInlineStack &InlineStack)
Definition: MCPseudoProbe.h:290
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:486
llvm::MCPseudoProbeBase::PseudoProbeFirstId
const static uint32_t PseudoProbeFirstId
Definition: MCPseudoProbe.h:118
llvm::MCPseudoProbeSection::empty
bool empty() const
Definition: MCPseudoProbe.h:310
llvm::MCDecodedPseudoProbeInlineTree::MCDecodedPseudoProbeInlineTree
MCDecodedPseudoProbeInlineTree()
Definition: MCPseudoProbe.h:279
llvm::MCPseudoProbeInlineTree
Definition: MCPseudoProbe.h:254
uint32_t
llvm::MCPseudoProbeBase::isEntry
bool isEntry() const
Definition: MCPseudoProbe.h:124
llvm::MCPseudoProbeBase::MCPseudoProbeBase
MCPseudoProbeBase(uint64_t G, uint64_t I, uint64_t At, uint8_t T)
Definition: MCPseudoProbe.h:121
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:231
llvm::MCPseudoProbeBase::isIndirectCall
bool isIndirectCall() const
Definition: MCPseudoProbe.h:138
llvm::MCPseudoProbeBase::getGuid
uint64_t getGuid() const
Definition: MCPseudoProbe.h:126
WithColor.h
llvm::MCPseudoProbeInlineTreeBase::addProbes
void addProbes(ProbeType Probe)
Definition: MCPseudoProbe.h:238
llvm::MCPseudoProbeTable::DdgPrintIndent
static int DdgPrintIndent
Definition: MCPseudoProbe.h:330
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::MCPseudoProbeBase::getIndex
uint64_t getIndex() const
Definition: MCPseudoProbe.h:128
llvm::MCPseudoProbeDecoder::getDummyInlineRoot
const MCDecodedPseudoProbeInlineTree & getDummyInlineRoot() const
Definition: MCPseudoProbe.h:405
PseudoProbe.h
llvm::MCDecodedPseudoProbeInlineTree::hasInlineSite
bool hasInlineSite() const
Definition: MCPseudoProbe.h:283
llvm::MCPseudoProbeDecoder::getCallProbeForAddr
const MCDecodedPseudoProbe * getCallProbeForAddr(uint64_t Address) const
Definition: MCPseudoProbe.cpp:521
llvm::MCPseudoProbeBase::isDirectCall
bool isDirectCall() const
Definition: MCPseudoProbe.h:142
llvm::MCPseudoProbe::MCPseudoProbe
MCPseudoProbe(MCSymbol *Label, uint64_t Guid, uint64_t Index, uint64_t Type, uint64_t Attributes)
Definition: MCPseudoProbe.h:159
llvm::MCPseudoProbeFlag::AddressDelta
@ AddressDelta
llvm::MCPseudoProbeDecoder::printProbesForAllAddresses
void printProbesForAllAddresses(raw_ostream &OS)
Definition: MCPseudoProbe.cpp:507
llvm::PseudoProbeType::Block
@ Block
llvm::MCPseudoProbeDecoder::getFuncDescForGUID
const MCPseudoProbeFuncDesc * getFuncDescForGUID(uint64_t GUID) const
Definition: MCPseudoProbe.cpp:540
llvm::MCDecodedPseudoProbeInlineTree
Definition: MCPseudoProbe.h:271
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:186
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::MCDecodedPseudoProbe
Definition: MCPseudoProbe.h:174
llvm::MCDecodedPseudoProbe::getInlineContext
void getInlineContext(SmallVectorImpl< MCPseduoProbeFrameLocation > &ContextStack, const GUIDProbeFunctionMap &GUID2FuncMAP) const
Definition: MCPseudoProbe.cpp:223
llvm::MCPseduoProbeFrameLocation
std::pair< StringRef, uint32_t > MCPseduoProbeFrameLocation
Definition: MCPseudoProbe.h:172
llvm::MCPseudoProbeDecoder::getInlinerDescForProbe
const MCPseudoProbeFuncDesc * getInlinerDescForProbe(const MCDecodedPseudoProbe *Probe) const
Definition: MCPseudoProbe.cpp:560
raw_ostream.h
llvm::MCPseudoProbeInlineTree::MCPseudoProbeInlineTree
MCPseudoProbeInlineTree(uint64_t Guid)
Definition: MCPseudoProbe.h:259
llvm::MCPseudoProbeDecoder::getAddress2ProbesMap
AddressProbesMap & getAddress2ProbesMap()
Definition: MCPseudoProbe.h:396
llvm::MCPseudoProbeBase::setAttributes
void setAttributes(uint8_t Attr)
Definition: MCPseudoProbe.h:148
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172
llvm::MCPseudoProbeBase::isBlock
bool isBlock() const
Definition: MCPseudoProbe.h:134
llvm::PseudoProbeType::DirectCall
@ DirectCall
llvm::MCPseudoProbeTable::emit
static void emit(MCObjectStreamer *MCOS)
Definition: MCPseudoProbe.cpp:194