PC sampling: online partial PC sampling decoding (#1004)

* PC sampling: online partial PC sampling decoding

PC sampling service decodes a PC sample partially
by replacing the PC with an id of the loaded code object instance
containing PC and the offset of the PC within that code object instance.

* PC sampling: marker records removed

* PC sampling parser: minor doc update in mock

* PC sampling: introducing rocprofiler_pc_t

* NULL value of the code object id introduced.

* Clarifying documenation related to PC offset.

* PC offset documentation improvement

* PC sampling parser benchmark: Reducing the number of samples to recreate half of performance.
This commit is contained in:
Vladimir Indic
2024-09-05 18:35:46 +02:00
committed by GitHub
parent fa91169479
commit 93e82663d9
12 changed files with 160 additions and 129 deletions
@@ -35,7 +35,7 @@ static bool
Benchmark(bool bWarmup)
{
constexpr size_t SAMPLE_PER_DISPATCH = 8192;
constexpr size_t DISP_PER_QUEUE = 12;
constexpr size_t DISP_PER_QUEUE = 8;
constexpr size_t NUM_QUEUES = MockDoorBell::num_unique_bells;
std::shared_ptr<MockRuntimeBuffer> buffer = std::make_shared<MockRuntimeBuffer>();
@@ -53,8 +53,10 @@ alloc_callback(rocprofiler_pc_sampling_record_t** buffer, uint64_t size, void* u
static bool
check_samples(rocprofiler_pc_sampling_record_t* samples, uint64_t size)
{
// TODO: replace with (code_obj_id, pc)
for(size_t i = 0; i < size; i++)
if(samples[i].correlation_id.internal != samples[i].pc) return false;
if(samples[i].correlation_id.internal != samples[i].pc.loaded_code_object_offset)
return false;
return true;
}
@@ -299,7 +299,10 @@ class WaveIssueAndErrorTest : public WaveSnapTest
{
rocprofiler_pc_sampling_record_t sample;
::memset(&sample, 0, sizeof(sample));
sample.pc = dispatch->unique_id;
// TODO: Since code objects are not mocked, use pc.loaded_code_object_offset
// as the absolute physical address of the mocked PC.
sample.pc.loaded_code_object_offset = dispatch->unique_id;
sample.correlation_id.internal = dispatch->getMockId().raw;
sample.flags.valid = valid && !error;