Typedefs | |
typedef VOID *(*) | LEVEL_PINCLIENT::TRACE_BUFFER_CALLBACK (BUFFER_ID id, THREADID tid, const CONTEXT *ctxt, VOID *buf, UINT64 numElements, VOID *v) |
Functions | |
BUFFER_ID | LEVEL_PINCLIENT::PIN_DefineTraceBuffer (size_t recordSize, UINT32 numPages, TRACE_BUFFER_CALLBACK fun, VOID *val) |
VOID * | LEVEL_PINCLIENT::PIN_AllocateBuffer (BUFFER_ID id) |
VOID | LEVEL_PINCLIENT::PIN_DeallocateBuffer (BUFFER_ID id, VOID *buf) |
VOID * | LEVEL_PINCLIENT::PIN_GetBufferPointer (CONTEXT *const ctxt, BUFFER_ID id) |
typedef VOID*(*) LEVEL_PINCLIENT::TRACE_BUFFER_CALLBACK(BUFFER_ID id, THREADID tid, const CONTEXT *ctxt, VOID *buf, UINT64 numElements, VOID *v) |
A call-back function which Pin calls whenever the tools needs to consume a trace buffer (e.g., the trace buffer is full).
[in] | id | The ID of the trace buffer. |
[in] | tid | The ID of the thread owning this buffer. |
[in] | buf | Pointer to the start of the buffer. |
[in] | numElements | The number of elements collected into the buffer which need to be consumed. |
[in] | v | The tool's call-back value. |
VOID* LEVEL_PINCLIENT::PIN_AllocateBuffer | ( | BUFFER_ID | id | ) |
Explicitly allocate a trace buffer. This is only needed for tools which use a "double buffering" technique. When used, the buffer pointer should be returned from the TRACE_BUFFER_CALLBACK call-back.
[in] | id | The ID of the trace buffer to allocate. |
VOID LEVEL_PINCLIENT::PIN_DeallocateBuffer | ( | BUFFER_ID | id, | |
VOID * | buf | |||
) |
Explicitly deallocate a trace buffer. This is only needed by tools using a "double buffering" technique, where it is used to deallocate buffers allocated via PIN_AllocateBuffer(). However, it may be safely called (with no effect) for a thread's implicit initial buffer.
[in] | id | The ID of the trace buffer. |
[in] | buf | Pointer to the start of the buffer. |
BUFFER_ID LEVEL_PINCLIENT::PIN_DefineTraceBuffer | ( | size_t | recordSize, | |
UINT32 | numPages, | |||
TRACE_BUFFER_CALLBACK | fun, | |||
VOID * | val | |||
) |
Define a trace buffer to use with the Pin trace buffer API. This function defines the shape of the buffer, but doesn't allocate the buffer itself. Each thread implicitly creates its first buffer on start-up. Additional buffers may then be created using PIN_AllocateBuffer, but this is only needed by tools using "double buffering".
Upon exit, the notification callback may be called on a different physical thread than the one that is exiting.
[in] | recordSize | Size (bytes) of each record in the buffer. This size must be less than the size of an OS page. |
[in] | numPages | The number of OS pages to allocate for each buffer. This size does not have to be an even multiple of recordSize. |
[in] | fun | A call-back function that is called whenever the buffer is full, or when the thread exits with a partially-full buffer. Note that when called for a full buffer, not during thread exit, this function is called WITHOUT holding any Pin locks. So that multiple threads may be executing the function simultaneously. It is the tool's responsibility to take care of the multi-thread safety of this function, and any functions called by it. |
[in] | val | Passed as the last argument to fun. |
VOID* LEVEL_PINCLIENT::PIN_GetBufferPointer | ( | CONTEXT *const | ctxt, | |
BUFFER_ID | id | |||
) |
Returns the address of the current position in the buffer. Needs a CONTEXT that was passed in as a call back argument or IARG_CONTEXT
[in] | id | The ID of the trace buffer. |
[in] | ctxt | CONTEXT |