Thread trace and Trace Decoder API tests and samples (#416)
* Adding test and samples to decoder * Fix sample * Formatting * Fix multi test * Disable sample * Fix tests * Format * Version fix * Locking the decoder * Add atomic * Review comments * Format * Adding readme * merge conflict and adding PCS+ATT test * Review comments * Properly disable PCS test * Update tests/rocprofv3/advanced-thread-trace/CMakeLists.txt * Adding back env var test * Name fix * Preload sample * Addressing review comments * Update docs --------- Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
此提交包含在:
@@ -48,15 +48,17 @@ dispatch_callback(rocprofiler_agent_id_t /* agent */,
|
||||
static std::atomic<size_t> count{0};
|
||||
if(count.fetch_add(1) > NUM_KERNELS) return ROCPROFILER_THREAD_TRACE_CONTROL_NONE;
|
||||
|
||||
assert(userdata && "Dispatch callback passed null!");
|
||||
assert(dispatch_userdata && "Dispatch callback passed null!");
|
||||
dispatch_userdata->ptr = userdata;
|
||||
|
||||
return ROCPROFILER_THREAD_TRACE_CONTROL_START_AND_STOP;
|
||||
}
|
||||
|
||||
int
|
||||
tool_init(rocprofiler_client_finalize_t /* fini_func */, void* tool_data)
|
||||
tool_init(rocprofiler_client_finalize_t /* fini_func */, void* /* tool_data */)
|
||||
{
|
||||
Callbacks::init();
|
||||
|
||||
static rocprofiler_context_id_t client_ctx = {0};
|
||||
|
||||
ROCPROFILER_CALL(rocprofiler_create_context(&client_ctx), "context creation");
|
||||
@@ -67,7 +69,7 @@ tool_init(rocprofiler_client_finalize_t /* fini_func */, void* tool_data)
|
||||
nullptr,
|
||||
0,
|
||||
Callbacks::tool_codeobj_tracing_callback,
|
||||
tool_data),
|
||||
nullptr),
|
||||
"code object tracing service configure");
|
||||
|
||||
std::vector<rocprofiler_thread_trace_parameter_t> params{};
|
||||
@@ -100,7 +102,7 @@ tool_init(rocprofiler_client_finalize_t /* fini_func */, void* tool_data)
|
||||
params.size(),
|
||||
dispatch_callback,
|
||||
Callbacks::shader_data_callback,
|
||||
tool_data),
|
||||
nullptr),
|
||||
"thread trace service configure");
|
||||
}
|
||||
|
||||
@@ -121,13 +123,6 @@ tool_init(rocprofiler_client_finalize_t /* fini_func */, void* tool_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
tool_fini(void* tool_data)
|
||||
{
|
||||
Callbacks::finalize_json(tool_data);
|
||||
delete static_cast<Callbacks::ToolData*>(tool_data);
|
||||
}
|
||||
|
||||
} // namespace Multi
|
||||
} // namespace ATTTest
|
||||
|
||||
@@ -147,11 +142,11 @@ rocprofiler_configure(uint32_t /* version */,
|
||||
ATTTest::Multi::client_id = id;
|
||||
|
||||
// create configure data
|
||||
static auto cfg = rocprofiler_tool_configure_result_t{
|
||||
sizeof(rocprofiler_tool_configure_result_t),
|
||||
&ATTTest::Multi::tool_init,
|
||||
&ATTTest::Multi::tool_fini,
|
||||
reinterpret_cast<void*>(new Callbacks::ToolData{"att_multi_test/"})};
|
||||
static auto cfg =
|
||||
rocprofiler_tool_configure_result_t{sizeof(rocprofiler_tool_configure_result_t),
|
||||
&ATTTest::Multi::tool_init,
|
||||
&Callbacks::finalize,
|
||||
nullptr};
|
||||
|
||||
// return pointer to configure data
|
||||
return &cfg;
|
||||
|
||||
新增問題並參考
封鎖使用者