LLDB mainline
|
HTR layer composed of blocks of the trace. More...
#include <TraceHTR.h>
Public Member Functions | |
HTRBlockLayer (size_t id) | |
Construct new block layer. | |
size_t | GetNumUnits () const override |
Get the total number of units (instruction or block) in this layer. | |
HTRBlockMetadata | GetMetadataByIndex (size_t index) const override |
Get the metadata of a unit (instruction or block) in the layer. | |
HTRBlock const * | GetBlockById (size_t block_id) const |
Get an HTRBlock from its block id. | |
llvm::ArrayRef< size_t > | GetBlockIdTrace () const |
Get the block ID trace for this layer. | |
void | AppendNewBlock (size_t block_id, HTRBlock &&block) |
Appends a new block to the layer. | |
void | AppendRepeatedBlock (size_t block_id) |
Appends a repeated block to the layer. | |
Public Member Functions inherited from lldb_private::IHTRLayer | |
IHTRLayer (size_t id) | |
Construct new HTR layer. | |
size_t | GetLayerId () const |
Get the ID of the layer. | |
virtual HTRBlockMetadata | GetMetadataByIndex (size_t index) const =0 |
Get the metadata of a unit (instruction or block) in the layer. | |
virtual size_t | GetNumUnits () const =0 |
Get the total number of units (instruction or block) in this layer. | |
HTRBlock | MergeUnits (size_t start_unit_index, size_t num_units) |
Creates a new block from the result of merging a contiguous sequence of "units" (instructions or blocks depending on layer type) in this layer This allows the implementation class to decide how to store/generate this metadata. | |
virtual | ~IHTRLayer ()=default |
Private Attributes | |
std::unordered_map< size_t, HTRBlock > | m_block_defs |
Maps a unique Block ID to the corresponding HTRBlock. | |
std::vector< size_t > | m_block_id_trace |
Reduce memory footprint by just storing a trace of block IDs and use m_block_defs to map a block_id to its corresponding HTRBlock. | |
Additional Inherited Members | |
Protected Attributes inherited from lldb_private::IHTRLayer | |
size_t | m_layer_id |
ID of the layer. | |
HTR layer composed of blocks of the trace.
See lldb/docs/htr.rst for comprehensive HTR documentation
Definition at line 244 of file TraceHTR.h.
|
inline |
Construct new block layer.
[in] | id | The layer's id. |
Definition at line 250 of file TraceHTR.h.
void HTRBlockLayer::AppendNewBlock | ( | size_t | block_id, |
HTRBlock && | block | ||
) |
Appends a new block to the layer.
[in] | block_id | The block id of the new block. |
[in] | block | The new HTRBlock to be appended to the layer. This block is moved into the layer. |
Definition at line 70 of file TraceHTR.cpp.
References m_block_defs, and m_block_id_trace.
void HTRBlockLayer::AppendRepeatedBlock | ( | size_t | block_id | ) |
Appends a repeated block to the layer.
[in] | block_id | The block id of the repeated block. |
Definition at line 75 of file TraceHTR.cpp.
References m_block_id_trace.
HTRBlock const * HTRBlockLayer::GetBlockById | ( | size_t | block_id | ) | const |
Get an HTRBlock from its block id.
[in] | block_id | The id of the block to retrieve. |
Definition at line 92 of file TraceHTR.cpp.
References m_block_defs.
llvm::ArrayRef< size_t > HTRBlockLayer::GetBlockIdTrace | ( | ) | const |
Get the block ID trace for this layer.
This block ID trace stores the block ID of each block that occured in the trace and the block defs map maps block ID to the corresponding HTRBlock.
Definition at line 100 of file TraceHTR.cpp.
References m_block_id_trace.
|
overridevirtual |
Get the metadata of a unit (instruction or block) in the layer.
[in] | index | The position of the unit in the layer. |
Implements lldb_private::IHTRLayer.
Definition at line 123 of file TraceHTR.cpp.
References lldb_private::HTRBlock::GetMetadata(), m_block_defs, and m_block_id_trace.
|
overridevirtual |
Get the total number of units (instruction or block) in this layer.
Implements lldb_private::IHTRLayer.
Definition at line 104 of file TraceHTR.cpp.
References m_block_id_trace.
|
private |
Maps a unique Block ID to the corresponding HTRBlock.
Definition at line 293 of file TraceHTR.h.
Referenced by AppendNewBlock(), GetBlockById(), and GetMetadataByIndex().
|
private |
Reduce memory footprint by just storing a trace of block IDs and use m_block_defs to map a block_id to its corresponding HTRBlock.
Definition at line 296 of file TraceHTR.h.
Referenced by AppendNewBlock(), AppendRepeatedBlock(), GetBlockIdTrace(), GetMetadataByIndex(), and GetNumUnits().