DynamoRIO
dynamorio::drmemtrace::pt2ir_t Class Reference

#include <pt2ir.h>

Public Member Functions

bool init (DR_PARAM_IN pt2ir_config_t &pt2ir_config, DR_PARAM_IN int verbosity=0, DR_PARAM_IN bool allow_non_fatal_decode_errors=false)
 
pt2ir_convert_status_t convert (DR_PARAM_IN const uint8_t *pt_data, DR_PARAM_IN size_t pt_data_size, DR_PARAM_INOUT drir_t *drir, DR_PARAM_OUT uint64_t *non_fatal_decode_error_count_out=nullptr)
 
bool init (DR_PARAM_IN pt2ir_config_t &pt2ir_config, DR_PARAM_IN int verbosity=0, DR_PARAM_IN bool allow_non_fatal_decode_errors=false)
 
pt2ir_convert_status_t convert (DR_PARAM_IN const uint8_t *pt_data, DR_PARAM_IN size_t pt_data_size, DR_PARAM_INOUT drir_t *drir, DR_PARAM_OUT uint64_t *non_fatal_decode_error_count_out=nullptr)
 

Detailed Description

pt2ir_t is a class that can convert PT raw trace to DynamoRIO's IR.

Member Function Documentation

◆ convert() [1/2]

pt2ir_convert_status_t dynamorio::drmemtrace::pt2ir_t::convert ( DR_PARAM_IN const uint8_t *  pt_data,
DR_PARAM_IN size_t  pt_data_size,
DR_PARAM_INOUT drir_t *  drir,
DR_PARAM_OUT uint64_t *  non_fatal_decode_error_count_out = nullptr 
)

The convert function performs two processes: (1) decode the PT raw trace into libipt's IR format pt_insn; (2) convert pt_insn into the DynamoRIO's IR format instr_t and append it to ilist inside the drir object.

Parameters
pt_dataThe PT raw trace.
pt_data_sizeThe size of PT raw trace.
drirThe drir object.
non_fatal_decode_error_count_outPointer to the integer where the count of non-fatal decode errors seen during conversion will be stored. Used only if allow_non_fatal_decode_errors was set to true in the init call. This is set only if we were still able to generate a converted trace, albeit with some PC discontinuities.
Returns
pt2ir_convert_status_t. If the conversion is successful, the function returns PT2IR_CONV_SUCCESS. Otherwise, the function returns the corresponding error code.

◆ convert() [2/2]

pt2ir_convert_status_t dynamorio::drmemtrace::pt2ir_t::convert ( DR_PARAM_IN const uint8_t *  pt_data,
DR_PARAM_IN size_t  pt_data_size,
DR_PARAM_INOUT drir_t *  drir,
DR_PARAM_OUT uint64_t *  non_fatal_decode_error_count_out = nullptr 
)

The convert function performs two processes: (1) decode the PT raw trace into libipt's IR format pt_insn; (2) convert pt_insn into the DynamoRIO's IR format instr_t and append it to ilist inside the drir object.

Parameters
pt_dataThe PT raw trace.
pt_data_sizeThe size of PT raw trace.
drirThe drir object.
non_fatal_decode_error_count_outPointer to the integer where the count of non-fatal decode errors seen during conversion will be stored. Used only if allow_non_fatal_decode_errors was set to true in the init call. This is set only if we were still able to generate a converted trace, albeit with some PC discontinuities.
Returns
pt2ir_convert_status_t. If the conversion is successful, the function returns PT2IR_CONV_SUCCESS. Otherwise, the function returns the corresponding error code.

◆ init() [1/2]

bool dynamorio::drmemtrace::pt2ir_t::init ( DR_PARAM_IN pt2ir_config_t pt2ir_config,
DR_PARAM_IN int  verbosity = 0,
DR_PARAM_IN bool  allow_non_fatal_decode_errors = false 
)

Initialize the PT instruction decoder and the sideband session.

Parameters
pt2ir_configThe configuration of PT raw trace.
verbosityThe verbosity level for notifications. If set to 0, only error logs are printed. If set to 1, all logs are printed. Default value is 0.
allow_non_fatal_decode_errorsWhether PT decode errors that are not fatal to the syscall PT trace's conversion are simply skipped past.
Returns
true if the instance is successfully initialized.

◆ init() [2/2]

bool dynamorio::drmemtrace::pt2ir_t::init ( DR_PARAM_IN pt2ir_config_t pt2ir_config,
DR_PARAM_IN int  verbosity = 0,
DR_PARAM_IN bool  allow_non_fatal_decode_errors = false 
)

Initialize the PT instruction decoder and the sideband session.

Parameters
pt2ir_configThe configuration of PT raw trace.
verbosityThe verbosity level for notifications. If set to 0, only error logs are printed. If set to 1, all logs are printed. Default value is 0.
allow_non_fatal_decode_errorsWhether PT decode errors that are not fatal to the syscall PT trace's conversion are simply skipped past.
Returns
true if the instance is successfully initialized.

The documentation for this class was generated from the following file:
  • /home/runner/work/dynamorio/dynamorio/build_release-64/clients/include/drmemtrace/pt2ir.h