--- title: "/ext/drpttracer/drpttracer.h File Reference" layout: default permalink: /drpttracer_8h.html ---
DynamoRIO
|
Header for DynamoRIO Intel PT Tracing Extension. More...
#include <inttypes.h>
Data Structures | |
struct | _pt_metadata_t |
struct | _drpttracer_output_t |
Typedefs | |
typedef struct _pt_metadata_t | pt_metadata_t |
typedef struct _drpttracer_output_t | drpttracer_output_t |
Functions | |
DR_EXPORT bool | drpttracer_init (void) |
DR_EXPORT void | drpttracer_exit (void) |
DR_EXPORT drpttracer_status_t | drpttracer_create_handle (IN void *drcontext, IN drpttracer_tracing_mode_t tracing_mode, IN uint pt_size_shift, IN uint sideband_size_shift, OUT void **tracer_handle) |
DR_EXPORT drpttracer_status_t | drpttracer_destroy_handle (IN void *drcontext, INOUT void *tracer_handle) |
DR_EXPORT drpttracer_status_t | drpttracer_start_tracing (IN void *drcontext, IN void *tracer_handle) |
DR_EXPORT drpttracer_status_t | drpttracer_stop_tracing (IN void *drcontext, IN void *tracer_handle, OUT drpttracer_output_t *output) |
DR_EXPORT drpttracer_status_t | drpttracer_get_pt_metadata (IN void *tracer_handle, OUT pt_metadata_t *pt_metadata) |
DR_EXPORT drpttracer_status_t | drpttracer_create_output (IN void *drcontext, IN uint pt_buf_size_shift, IN size_t sd_buf_size_shift, OUT drpttracer_output_t **output) |
DR_EXPORT drpttracer_status_t | drpttracer_destroy_output (IN void *drcontext, IN drpttracer_output_t *output) |
Header for DynamoRIO Intel PT Tracing Extension.
typedef struct _drpttracer_output_t drpttracer_output_t |
The storage container type of drpttracer's output. This data struct is used by drpttracer to store PT trace, and sideband data. These data can be dumped into different files by the client. These files can be the inputs of pt2ir_t, which decodes the PT data into Dynamorio's IR.
typedef struct _pt_metadata_t pt_metadata_t |
The type of PT trace's metadata.
enum drpttracer_status_t |
Success code for each drpttracer operation.
The tracing modes for drpttracer_start_tracing().
XXX: The DRPTTRACER_TRACING_ONLY_USER and DRPTTRACER_TRACING_USER_AND_KERNEL modes are not completely supported yet. The sideband data collected in these two modes do not include the initial mmap2 event recording. Therefore, if the user uses pt2ir_t in sideband converter mode, pt2ir_t cannot find the image and cannot decode the PT trace.
DR_EXPORT drpttracer_status_t drpttracer_create_handle | ( | IN void * | drcontext, |
IN drpttracer_tracing_mode_t | tracing_mode, | ||
IN uint | pt_size_shift, | ||
IN uint | sideband_size_shift, | ||
OUT void ** | tracer_handle ) |
Create a pttracer handle. Must be called after drpttracer_init() and before drpttracer_exit(). The handle is used to start and stop PT tracing.
[in] | drcontext | The context of DynamoRIO. |
[in] | tracing_mode | The tracing mode. |
[in] | pt_size_shift | The size shift of PT trace's ring buffer. |
[in] | sideband_size_shift | The size shift of sideband data's ring buffer. |
[out] | tracer_handle | The pttracer handle. |
DR_EXPORT drpttracer_status_t drpttracer_create_output | ( | IN void * | drcontext, |
IN uint | pt_buf_size_shift, | ||
IN size_t | sd_buf_size_shift, | ||
OUT drpttracer_output_t ** | output ) |
Creates an output object of drpttracer.
[in] | drcontext | The context of DynamoRIO. |
[in] | pt_buf_size_shift | The size shift of the PT trace's output buffer. |
[in] | sd_buf_size_shift | The size shift of the sideband data's output buffer. |
[out] | output | The output object that will be created. |
DR_EXPORT drpttracer_status_t drpttracer_destroy_handle | ( | IN void * | drcontext, |
INOUT void * | tracer_handle ) |
Destroy a pttracer handle and release the resources. Must be called after drpttracer_init() and before drpttracer_exit().
[in] | drcontext | The context of DynamoRIO. |
[in] | tracer_handle | The pttracer handle. |
DR_EXPORT drpttracer_status_t drpttracer_destroy_output | ( | IN void * | drcontext, |
IN drpttracer_output_t * | output ) |
Destroys an output object of drpttracer.
[in] | drcontext | The context of DynamoRIO. |
[in] | output | The output object that will be destroyed. |
DR_EXPORT void drpttracer_exit | ( | void | ) |
Cleans up the drpttracer extension.
DR_EXPORT drpttracer_status_t drpttracer_get_pt_metadata | ( | IN void * | tracer_handle, |
OUT pt_metadata_t * | pt_metadata ) |
Get the PT metadata of the given pttracer handle.
[in] | tracer_handle | The pttracer handle. |
[out] | pt_metadata | The PT metadata of the current pttracer handle. |
DR_EXPORT bool drpttracer_init | ( | void | ) |
Initializes the drpttracer extension. Must be called prior to any of the other routines. Can be called multiple times (by separate components, normally) but each call must be paired with a corresponding call to drpttracer_exit().
DR_EXPORT drpttracer_status_t drpttracer_start_tracing | ( | IN void * | drcontext, |
IN void * | tracer_handle ) |
Start a PT tracing session. Must pass a valid pttracer handle to this function.
[in] | drcontext | The context of DynamoRIO. |
[in] | tracer_handle | The pttracer handle. |
DR_EXPORT drpttracer_status_t drpttracer_stop_tracing | ( | IN void * | drcontext, |
IN void * | tracer_handle, | ||
OUT drpttracer_output_t * | output ) |
Stops a PT tracing session. Must pass a valid pttracer handle to this function.
[in] | drcontext | The context of DynamoRIO. |
[in] | tracer_handle | The pttracer handle. |
[out] | output | The output of PT tracing. This function will allocate and fill this output. It will copy the PT trace to the pt_buf of the output. When the tracing mode is DRPTTRACER_TRACING_ONLY_USER or DRPTTRACER_TRACING_USER_AND_KERNEL, the PT sideband data will be copied to the sideband_buf of the output. When the tracing mode is DRPTTRACER_TRACING_ONLY_KERNEL, it will not copy the sideband data to the buffer. |