Fixing issues caused by the plugin patches
- Multithreaded Applications and plugin destruction
- Fixing Async-copy trace in file plugin
- Adding the assert checkups for every trace buffer flush function
Change-Id: I96e096fd7ee2604931200a0b446edb5ce49959dd
[ROCm/roctracer commit: 4cd7497a87]
This commit is contained in:
committed by
Ammar Elwazir
parent
dfc856d164
commit
699d17b733
@@ -322,7 +322,7 @@ class file_plugin_t {
|
|||||||
output_file = get_output_file(ACTIVITY_DOMAIN_HSA_OPS, begin->op);
|
output_file = get_output_file(ACTIVITY_DOMAIN_HSA_OPS, begin->op);
|
||||||
if (begin->op == HSA_OP_ID_COPY) {
|
if (begin->op == HSA_OP_ID_COPY) {
|
||||||
*output_file << std::dec << begin->begin_ns << ":" << begin->end_ns
|
*output_file << std::dec << begin->begin_ns << ":" << begin->end_ns
|
||||||
<< " async-copy:" << begin->correlation_id << " " << GetPid() << std::endl;
|
<< " async-copy:" << begin->correlation_id << ":" << GetPid() << std::endl;
|
||||||
break;
|
break;
|
||||||
} else if (begin->op == HSA_OP_ID_RESERVED1) {
|
} else if (begin->op == HSA_OP_ID_RESERVED1) {
|
||||||
*output_file << std::dec << begin->pc_sample.se << " " << begin->pc_sample.cycle << " "
|
*output_file << std::dec << begin->pc_sample.se << " " << begin->pc_sample.cycle << " "
|
||||||
|
|||||||
@@ -222,11 +222,11 @@ struct roctx_trace_entry_t {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
roctracer::TraceBuffer<roctx_trace_entry_t> roctx_trace_buffer("rocTX API", 0x200000,
|
roctracer::TraceBuffer<roctx_trace_entry_t> roctx_trace_buffer(
|
||||||
[](roctx_trace_entry_t* entry) {
|
"rocTX API", 0x200000, [](roctx_trace_entry_t* entry) {
|
||||||
plugin->write_callback_record(
|
assert(plugin && "plugin is not initialized");
|
||||||
&entry->record, &entry->data);
|
plugin->write_callback_record(&entry->record, &entry->data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// rocTX callback function
|
// rocTX callback function
|
||||||
void roctx_api_callback(uint32_t domain, uint32_t cid, const void* callback_data,
|
void roctx_api_callback(uint32_t domain, uint32_t cid, const void* callback_data,
|
||||||
@@ -265,6 +265,7 @@ struct hsa_api_trace_entry_t {
|
|||||||
|
|
||||||
roctracer::TraceBuffer<hsa_api_trace_entry_t> hsa_api_trace_buffer(
|
roctracer::TraceBuffer<hsa_api_trace_entry_t> hsa_api_trace_buffer(
|
||||||
"HSA API", 0x200000, [](hsa_api_trace_entry_t* entry) {
|
"HSA API", 0x200000, [](hsa_api_trace_entry_t* entry) {
|
||||||
|
assert(plugin && "plugin is not initialized");
|
||||||
plugin->write_callback_record(&entry->record, &entry->data);
|
plugin->write_callback_record(&entry->record, &entry->data);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -400,6 +401,7 @@ static std::optional<std::string> getKernelName(uint32_t cid, const hip_api_data
|
|||||||
|
|
||||||
roctracer::TraceBuffer<hip_api_trace_entry_t> hip_api_trace_buffer(
|
roctracer::TraceBuffer<hip_api_trace_entry_t> hip_api_trace_buffer(
|
||||||
"HIP API", 0x200000, [](hip_api_trace_entry_t* entry) {
|
"HIP API", 0x200000, [](hip_api_trace_entry_t* entry) {
|
||||||
|
assert(plugin && "plugin is not initialized");
|
||||||
plugin->write_callback_record(&entry->record, &entry->data);
|
plugin->write_callback_record(&entry->record, &entry->data);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -495,6 +497,7 @@ void open_tracing_pool() {
|
|||||||
roctracer_properties_t properties{};
|
roctracer_properties_t properties{};
|
||||||
properties.buffer_size = 0x80000;
|
properties.buffer_size = 0x80000;
|
||||||
properties.buffer_callback_fun = [](const char* begin, const char* end, void* /* arg */) {
|
properties.buffer_callback_fun = [](const char* begin, const char* end, void* /* arg */) {
|
||||||
|
assert(plugin && "plugin is not initialized");
|
||||||
plugin->write_activity_records(reinterpret_cast<const roctracer_record_t*>(begin),
|
plugin->write_activity_records(reinterpret_cast<const roctracer_record_t*>(begin),
|
||||||
reinterpret_cast<const roctracer_record_t*>(end));
|
reinterpret_cast<const roctracer_record_t*>(end));
|
||||||
};
|
};
|
||||||
@@ -550,8 +553,6 @@ void tool_unload() {
|
|||||||
// Flush tracing pool
|
// Flush tracing pool
|
||||||
close_tracing_pool();
|
close_tracing_pool();
|
||||||
roctracer::TraceBufferBase::FlushAll();
|
roctracer::TraceBufferBase::FlushAll();
|
||||||
|
|
||||||
plugin.reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// tool load method
|
// tool load method
|
||||||
|
|||||||
Reference in New Issue
Block a user