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 authored and GitHub committed 2024-10-22 18:09:25 +05:30
1 親 a92fa8f071
コミット 3f91d90bbc
36ファイル変更
+66 -61

検索条件に一致するファイルはありません

+1 -1
ファイルの表示
@@ -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
+1 -1
ファイルの表示
@@ -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