Check to force tools to initialize the ctx id to zero. (#1135)

* Check to force tool to initialize the ctx id to zero.

* initialize rocprofiler_context_id_t with 0 in units tests

* changelog

---------

Co-authored-by: Gopesh Bhardwaj <gopesh.bhardwaj@amd.com>
这个提交包含在:
venkat1361和Gopesh Bhardwaj 编写, GitHub 于 2024-10-22 18:09:25 +05:30 提交
1 父节点 a92fa8f071
当前提交 3f91d90bbc
36 个文件已更改
+66 -61

没有与搜索条件相匹配的文件

@@ -84,7 +84,7 @@ rocprofiler_assign_callback_thread(rocprofiler_buffer_id_t buffer_id,
```cpp
{
// create a context
auto context_id = rocprofiler_context_id_t{};
auto context_id = rocprofiler_context_id_t{0};
rocprofiler_create_context(&context_id);
// create a buffer associated with the context
@@ -31,7 +31,7 @@ This guide explains how to setup dispatch and agent profiling along will describ
The setup for dispatch and agent profiling is similar (with only minor changes needed to adapt code from one to another). In tool_init, similar to tracing services, you need to create a context and a buffer to collect the output. Important Note: buffered_callback in rocprofiler_create_buffer is called when the buffer is full with a vector of collected counter samples, see the buffered callback section below for processing.
```CPP
rocprofiler_context_id_t ctx;
rocprofiler_context_id_t ctx{0};
rocprofiler_buffer_id_t buff;
ROCPROFILER_CALL(rocprofiler_create_context(&ctx), "context creation failed");
ROCPROFILER_CALL(rocprofiler_create_buffer(ctx,
+2 -2
查看文件
@@ -92,7 +92,7 @@ tool_init(rocprofiler_client_finalize_t fini_func,
void* data_v)
{
// create a context
auto ctx = rocprofiler_context_id_t{};
auto ctx = rocprofiler_context_id_t{0};
rocprofiler_create_context(&ctx);
// ... associate services with context ...
@@ -178,7 +178,7 @@ tool_init(rocprofiler_client_finalize_t fini_func,
tool_data->finalizer = fini_func;
// create a context
auto ctx = rocprofiler_context_id_t{};
auto ctx = rocprofiler_context_id_t{0};
rocprofiler_create_context(&ctx);
// Save your contexts