GTPin

- Main Page
- Related Pages
- Modules
- Data Structures

Data Structures
Profile Buffer
GTPin: Kernel

Interface of the memory buffer that stores profile data of the kernel More...

## Data Structures
class | gtpin::GtProfileArray
| Class that represents an array of data records in the profile buffer. More...
class | gtpin::GtProfileTrace
| Class that represents a trace - sequence of data records chronologically collected and stored in the profile buffer. More...
class | gtpin::IGtProfileBuffer
| Abstract representation of the profile data storage. More...
class | gtpin::IGtProfileBufferAllocator
| Abstract class that provides interface for allocation (reservation) memory blocks in the profile buffer. More...

## Detailed Description

Interface of the memory buffer that stores profile data of the kernel

Profile buffer is the aggregate storage for all data collected by a single run of the instrumented kernel.
The storage is allocated at the instrumentation phase, when the tool handles the IGtTool::OnKernelBuild callback. The allocation interface is provided by the IGtProfileBufferAllocator object that is sent to the tool along with the callback (see IGtKernelInstrument::ProfileBufferAllocator()).
For storage of a simple structure, the allocation can be done by a single call to the IGtProfileBufferAllocator::Allocate function. If a tool needs multiple complex structures for its profile data, it can allocate space incrementally, by calling IGtProfileBufferAllocator::Allocate per each structure separately. In this case, the profile buffer allocator will aggregate all allocation requests to accomodate all of them in a single, contiguous memory buffer.

Note:
  Allocation of the buffer at the instrumentation phase does not reserve a corresponding physical storage in CPU/GPU memory. In fact, this is more like creating the scheme of the buffer, rather than assigning space in the physical memory.

Real assignment of the physical memory space for the profile buffer occurs when the tool calls the IGtKernelDispatch::CreateProfileBuffer function during the IGtTool::OnKernelRun callback handling. This fuction returns the IGtProfileBuffer object that provides read/write access to the data in the allocated profile buffer.

Both IGtProfileBuffer and IGtProfileBufferAllocator are abstract interfaces that allow allocation and manipulation of profile data of any complexity. Additionally, GTPin API provides two inline wrappers of these interfaces that implement the two most popular profile data structures:

- GtProfileArray represents an array of data records in the profile buffer. The data can be collected in a single global array or distributed among multiple thread buckets
- GtProfileTrace represents a trace - sequence of data records chronologically collected and stored in the profile buffer

All Data Structures Functions Variables Typedefs Enumerations Enumerator

      Copyright (C) 2013-2025 Intel Corporation

      SPDX-License-Identifier: MIT