ATT Doc updates. Fix trace-decode return error. (#406)
* Doc updates. Some cleanup. * Formatting --------- Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
This commit is contained in:
committed by
GitHub
orang tua
e587a8b23a
melakukan
3cb0c87f53
@@ -22,11 +22,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rocprofiler-sdk/experimental/thread-trace/trace_decoder.h>
|
||||
|
||||
#include "lib/att-tool/util.hpp"
|
||||
#include "lib/common/filesystem.hpp"
|
||||
|
||||
#include <rocprofiler-sdk/experimental/thread-trace/trace_decoder.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
@@ -62,11 +62,11 @@ get_trace_data(rocprofiler_thread_trace_decoder_record_type_t trace_id,
|
||||
else if(trace_id == ROCPROFILER_THREAD_TRACE_DECODER_RECORD_OCCUPANCY)
|
||||
{
|
||||
for(size_t i = 0; i < trace_size; i++)
|
||||
tool.config.occupancy.push_back(reinterpret_cast<const occupancy_t*>(trace_events)[i]);
|
||||
tool.config.occupancy.push_back(static_cast<const occupancy_t*>(trace_events)[i]);
|
||||
}
|
||||
else if(trace_id == ROCPROFILER_THREAD_TRACE_DECODER_RECORD_PERFEVENT)
|
||||
{
|
||||
PerfcounterFile(tool.config, reinterpret_cast<perfevent_t*>(trace_events), trace_size);
|
||||
PerfcounterFile(tool.config, static_cast<perfevent_t*>(trace_events), trace_size);
|
||||
}
|
||||
|
||||
if(trace_id != ROCPROFILER_THREAD_TRACE_DECODER_RECORD_WAVE) return;
|
||||
@@ -74,12 +74,12 @@ get_trace_data(rocprofiler_thread_trace_decoder_record_type_t trace_id,
|
||||
bool bInvalid = false;
|
||||
for(size_t wave_n = 0; wave_n < trace_size; wave_n++)
|
||||
{
|
||||
auto& wave = reinterpret_cast<wave_t*>(trace_events)[wave_n];
|
||||
int64_t prev_inst_time = wave.begin_time;
|
||||
const auto& wave = static_cast<const wave_t*>(trace_events)[wave_n];
|
||||
int64_t prev_inst_time = wave.begin_time;
|
||||
|
||||
for(size_t j = 0; j < wave.instructions_size; j++)
|
||||
{
|
||||
auto& inst = wave.instructions_array[j];
|
||||
const auto& inst = wave.instructions_array[j];
|
||||
if(inst.pc.marker_id == 0 && inst.pc.addr == 0) continue;
|
||||
|
||||
try
|
||||
|
||||
@@ -236,6 +236,13 @@ rocprofiler_trace_decode(rocprofiler_thread_trace_decoder_handle_t handle,
|
||||
const char* statustr = decoder->dl->att_status_fn(status);
|
||||
if(statustr == nullptr) statustr = "Unknown error";
|
||||
ROCP_ERROR << "Callback failed with status " << status << ": " << statustr;
|
||||
|
||||
if(status == ROCPROFILER_THREAD_TRACE_DECODER_STATUS_ERROR_INVALID_ARGUMENT)
|
||||
return ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT;
|
||||
else if(status == ROCPROFILER_THREAD_TRACE_DECODER_STATUS_ERROR_INVALID_SHADER_DATA)
|
||||
return ROCPROFILER_STATUS_ERROR_AGENT_ARCH_NOT_SUPPORTED;
|
||||
else
|
||||
return ROCPROFILER_STATUS_ERROR;
|
||||
}
|
||||
|
||||
return ROCPROFILER_STATUS_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user