LLDB mainline
|
Metadata associated with an HTR block See lldb/docs/htr.rst for comprehensive HTR documentation. More...
#include <TraceHTR.h>
Public Member Functions | |
HTRBlockMetadata (lldb::addr_t first_instruction_load_address, size_t num_instructions, llvm::DenseMap< ConstString, size_t > &&func_calls) | |
Constructor for a block's metadata. | |
size_t | GetNumInstructions () const |
Get the number of instructions in the block. | |
std::optional< llvm::StringRef > | GetMostFrequentlyCalledFunction () const |
Get the name of the most frequently called function from the block. | |
lldb::addr_t | GetFirstInstructionLoadAddress () const |
Get the load address of the first instruction in the block. | |
llvm::DenseMap< ConstString, size_t > const & | GetFunctionCalls () const |
Get the function calls map for the block. | |
Static Public Member Functions | |
static void | MergeMetadata (HTRBlockMetadata &merged_metadata, HTRBlockMetadata const &metadata_to_merge) |
Merge two HTRBlockMetadata in place. | |
Private Attributes | |
lldb::addr_t | m_first_instruction_load_address |
size_t | m_num_instructions |
llvm::DenseMap< ConstString, size_t > | m_func_calls |
Metadata associated with an HTR block See lldb/docs/htr.rst for comprehensive HTR documentation.
Definition at line 23 of file TraceHTR.h.
|
inline |
Constructor for a block's metadata.
[in] | first_instruction_load_address | The load address of the block's first instruction. |
[in] | num_instructions | The total number of instructions in the block. |
[in] | func_calls | The map of a function name to the number of times it is called from the block. |
Definition at line 36 of file TraceHTR.h.
lldb::addr_t HTRBlockMetadata::GetFirstInstructionLoadAddress | ( | ) | const |
Get the load address of the first instruction in the block.
Definition at line 46 of file TraceHTR.cpp.
References m_first_instruction_load_address.
Referenced by lldb_private::BasicSuperBlockMerge(), and lldb_private::toJSON().
llvm::DenseMap< ConstString, size_t > const & HTRBlockMetadata::GetFunctionCalls | ( | ) | const |
Get the function calls map for the block.
Function calls are identified in the instruction layer by finding 'call' instructions and determining the function they are calling. As these instructions are merged into blocks, we merge these different function calls into a single map containing the function names to the number of times it is called from this block.
Definition at line 42 of file TraceHTR.cpp.
References m_func_calls.
Referenced by lldb_private::toJSON().
std::optional< llvm::StringRef > HTRBlockMetadata::GetMostFrequentlyCalledFunction | ( | ) | const |
Get the name of the most frequently called function from the block.
Definition at line 27 of file TraceHTR.cpp.
References lldb_private::ConstString::GetStringRef(), and m_func_calls.
Referenced by lldb_private::toJSON().
size_t HTRBlockMetadata::GetNumInstructions | ( | ) | const |
Get the number of instructions in the block.
Definition at line 22 of file TraceHTR.cpp.
References m_num_instructions.
Referenced by lldb_private::toJSON().
|
static |
Merge two HTRBlockMetadata in place.
[in] |
out] merged_metadata Metadata that metadata_to_merge will be merged into.
[in] | metadata_to_merge | Metadata to merge into merged_metadata. |
Definition at line 189 of file TraceHTR.cpp.
References m_func_calls, and m_num_instructions.
Referenced by lldb_private::IHTRLayer::MergeUnits().
|
private |
Definition at line 83 of file TraceHTR.h.
Referenced by GetFirstInstructionLoadAddress().
|
private |
Definition at line 85 of file TraceHTR.h.
Referenced by GetFunctionCalls(), GetMostFrequentlyCalledFunction(), and MergeMetadata().
|
private |
Definition at line 84 of file TraceHTR.h.
Referenced by GetNumInstructions(), and MergeMetadata().