sqtt size setting, ctx limit, heartbeat
Change-Id: I98de62e950b9201d03a9ca82cee9e2bbc2666e63
[ROCm/rocprofiler commit: ef761725b4]
This commit is contained in:
@@ -426,11 +426,11 @@ class Context {
|
||||
if (rinfo->data.result_bytes.copy) {
|
||||
if (sample_id == 0) {
|
||||
if (rinfo->data.result_bytes.size == 0) {
|
||||
const uint32_t output_buffer_size = SqttProfile::output_buffer_size;
|
||||
const uint32_t output_buffer_size = SqttProfile::GetSize();
|
||||
const uint32_t output_buffer_size64 = output_buffer_size / sizeof(uint64_t);
|
||||
rinfo->data.result_bytes.ptr = calloc(output_buffer_size64, sizeof(uint64_t));
|
||||
rinfo->data.result_bytes.size = output_buffer_size;
|
||||
} else if (rinfo->data.result_bytes.size != SqttProfile::output_buffer_size) {
|
||||
} else if (rinfo->data.result_bytes.size != SqttProfile::GetSize()) {
|
||||
EXC_RAISING(HSA_STATUS_ERROR, "result bytes copy mode, data array size mismatch(" << rinfo->data.result_bytes.size << ")");
|
||||
}
|
||||
}
|
||||
@@ -450,8 +450,9 @@ class Context {
|
||||
rinfo->data.result_bytes.instance_count = sample_id + 1;
|
||||
rinfo->data.kind = ROCPROFILER_DATA_KIND_BYTES;
|
||||
}
|
||||
} else
|
||||
status = HSA_STATUS_ERROR;
|
||||
} else {
|
||||
EXC_RAISING(HSA_STATUS_ERROR, "result bytes copy mode, out of boundary, size = " << rinfo->data.result_bytes.size);
|
||||
}
|
||||
} else {
|
||||
if (sample_id == 0) {
|
||||
rinfo->data.result_bytes.ptr = ainfo_data->sqtt_data.ptr;
|
||||
@@ -460,8 +461,9 @@ class Context {
|
||||
rinfo->data.result_bytes.instance_count += 1;
|
||||
rinfo->data.kind = ROCPROFILER_DATA_KIND_BYTES;
|
||||
}
|
||||
} else
|
||||
status = HSA_STATUS_ERROR;
|
||||
} else {
|
||||
EXC_RAISING(HSA_STATUS_ERROR, "unknown data type = " << ainfo_type);
|
||||
}
|
||||
} else
|
||||
status = HSA_STATUS_ERROR;
|
||||
|
||||
|
||||
@@ -14,5 +14,5 @@ InterceptQueue::obj_map_t* InterceptQueue::obj_map_ = NULL;
|
||||
const char* InterceptQueue::kernel_none_ = "";
|
||||
uint64_t InterceptQueue::timeout_ = UINT64_MAX;
|
||||
Tracker* InterceptQueue::tracker_ = NULL;
|
||||
bool InterceptQueue::tracker_on_ = false;
|
||||
bool InterceptQueue::tracker_on_ = true;
|
||||
} // namespace rocprofiler
|
||||
|
||||
@@ -210,7 +210,8 @@ class PmcProfile : public Profile {
|
||||
|
||||
class SqttProfile : public Profile {
|
||||
public:
|
||||
static const uint32_t output_buffer_size = 0x2000000; // 32M
|
||||
static inline void SetSize(const uint32_t& size) { output_buffer_size_ = size; }
|
||||
static inline uint32_t GetSize() { return output_buffer_size_; }
|
||||
|
||||
SqttProfile(const util::AgentInfo* agent_info) : Profile(agent_info) {
|
||||
profile_.type = HSA_VEN_AMD_AQLPROFILE_EVENT_TYPE_SQTT;
|
||||
@@ -224,7 +225,7 @@ class SqttProfile : public Profile {
|
||||
}
|
||||
|
||||
hsa_status_t Allocate(util::HsaRsrcFactory* rsrc) {
|
||||
profile_.output_buffer.size = output_buffer_size;
|
||||
profile_.output_buffer.size = output_buffer_size_;
|
||||
profile_.command_buffer.ptr =
|
||||
rsrc->AllocateSysMemory(agent_info_, profile_.command_buffer.size);
|
||||
profile_.output_buffer.ptr =
|
||||
@@ -232,6 +233,9 @@ class SqttProfile : public Profile {
|
||||
return (profile_.command_buffer.ptr && profile_.output_buffer.ptr) ? HSA_STATUS_SUCCESS
|
||||
: HSA_STATUS_ERROR;
|
||||
}
|
||||
|
||||
private:
|
||||
static uint32_t output_buffer_size_;
|
||||
};
|
||||
|
||||
} // namespace rocprofiler
|
||||
|
||||
@@ -142,12 +142,19 @@ void UnloadTool() {
|
||||
CONSTRUCTOR_API void constructor() {
|
||||
util::Logger::Create();
|
||||
|
||||
const char* sqtt_size_str = getenv("ROCP_SQTT_SIZE");
|
||||
if (sqtt_size_str != NULL) {
|
||||
const uint32_t sqtt_size_val = strtoull(sqtt_size_str, NULL, 0);
|
||||
SqttProfile::SetSize(sqtt_size_val);
|
||||
}
|
||||
|
||||
const char* timeout_str = getenv("ROCP_DATA_TIMEOUT");
|
||||
if (timeout_str != NULL) {
|
||||
const uint64_t timeout_val = strtoull(timeout_str, NULL, 0);
|
||||
Context::SetTimeout(timeout_val);
|
||||
InterceptQueue::SetTimeout(timeout_val);
|
||||
}
|
||||
|
||||
const char* tracker_on_str = getenv("ROCP_TRACKER_ON");
|
||||
if (tracker_on_str != NULL) {
|
||||
if (strncmp(tracker_on_str, "true", 4) == 0) InterceptQueue::TrackerOn(true);
|
||||
@@ -178,10 +185,11 @@ const MetricsDict* GetMetrics(const hsa_agent_t& agent) {
|
||||
return metrics;
|
||||
}
|
||||
|
||||
rocprofiler::Tracker::mutex_t rocprofiler::Tracker::mutex_;
|
||||
uint64_t Context::timeout_ = UINT64_MAX;
|
||||
uint32_t SqttProfile::output_buffer_size_ = 0x2000000; // 32M
|
||||
Tracker::mutex_t Tracker::mutex_;
|
||||
util::Logger::mutex_t util::Logger::mutex_;
|
||||
util::Logger* util::Logger::instance_ = NULL;
|
||||
uint64_t Context::timeout_ = UINT64_MAX;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user