Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/include/llvm/MC/MCPseudoProbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ class MCDecodedPseudoProbe : public MCPseudoProbeBase {
// \p ContextStack is populated in root to leaf order
LLVM_ABI void
getInlineContext(SmallVectorImpl<MCPseudoProbeFrameLocation> &ContextStack,
const GUIDProbeFunctionMap &GUID2FuncMAP) const;
const GUIDProbeFunctionMap &GUID2FuncMAP,
bool ShowName = true) const;

// Helper function to get the string from context stack
LLVM_ABI std::string
getInlineContextStr(const GUIDProbeFunctionMap &GUID2FuncMAP) const;
getInlineContextStr(const GUIDProbeFunctionMap &GUID2FuncMAP,
bool ShowName = true) const;

// Print pseudo probe while disassembling
LLVM_ABI void print(raw_ostream &OS, const GUIDProbeFunctionMap &GUID2FuncMAP,
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/MC/MCPseudoProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ void MCPseudoProbeFuncDesc::print(raw_ostream &OS) {

void MCDecodedPseudoProbe::getInlineContext(
SmallVectorImpl<MCPseudoProbeFrameLocation> &ContextStack,
const GUIDProbeFunctionMap &GUID2FuncMAP) const {
const GUIDProbeFunctionMap &GUID2FuncMAP, bool ShowName) const {
uint32_t Begin = ContextStack.size();
MCDecodedPseudoProbeInlineTree *Cur = InlineTree;
// It will add the string of each node's inline site during iteration.
Expand All @@ -299,10 +299,10 @@ void MCDecodedPseudoProbe::getInlineContext(
}

std::string MCDecodedPseudoProbe::getInlineContextStr(
const GUIDProbeFunctionMap &GUID2FuncMAP) const {
const GUIDProbeFunctionMap &GUID2FuncMAP, bool ShowName) const {
std::ostringstream OContextStr;
SmallVector<MCPseudoProbeFrameLocation, 16> ContextStack;
getInlineContext(ContextStack, GUID2FuncMAP);
getInlineContext(ContextStack, GUID2FuncMAP, ShowName);
for (auto &Cxt : ContextStack) {
if (OContextStr.str().size())
OContextStr << " @ ";
Expand All @@ -328,7 +328,7 @@ void MCDecodedPseudoProbe::print(raw_ostream &OS,
if (Discriminator)
OS << "Discriminator: " << Discriminator << " ";
OS << "Type: " << PseudoProbeTypeStr[static_cast<uint8_t>(Type)] << " ";
std::string InlineContextStr = getInlineContextStr(GUID2FuncMAP);
std::string InlineContextStr = getInlineContextStr(GUID2FuncMAP, ShowName);
if (InlineContextStr.size()) {
OS << "Inlined: @ ";
OS << InlineContextStr;
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.