Adding agent-index (#189)

* Adding agent-index

* review changes

* review comments addressed

* minor fix

* fix CI failure

* review comments

* Fix agent index test and address review comments

* Build Fixes

---------

Co-authored-by: Benjamin Welton <bewelton@amd.com>
此提交包含在:
Nagaraj, Sriraksha
2025-03-14 02:51:32 -05:00
提交者 GitHub
父節點 2fe63d873e
當前提交 c30bb7cbda
共有 32 個檔案被更改,包括 604 行新增108 行删除
+23 -1
查看文件
@@ -44,6 +44,8 @@
#include <rocprofiler-sdk/cxx/name_info.hpp>
#include <rocprofiler-sdk/cxx/operators.hpp>
#include <fmt/core.h>
#include <cstdint>
#include <map>
#include <string>
@@ -86,6 +88,26 @@ using code_object_load_info_vec_t = std::vector<rocprofiler::att_wrapper::Codeob
template <typename Tp>
using synced_map = common::Synchronized<Tp, true>;
enum class agent_indexing
{
node = 0,
logical_node,
logical_node_type,
};
struct agent_index
{
std::string_view label = {}; // e.g. Agent, CPU, GPU
uint32_t index = 0; // the numerical index
std::string_view type = {}; // e.g. CPU, GPU, etc.
// returns label + index
std::string as_string(std::string_view sep = " ") const
{
return fmt::format("{}{}{}", label, sep, index);
}
};
struct metadata
{
using agent_info_ptr_vec_t = common::container::small_vector<const agent_info*, 16>;
@@ -165,7 +187,7 @@ struct metadata
rocprofiler_tracing_operation_t op) const;
std::string_view get_operation_name(rocprofiler_buffer_tracing_kind_t kind,
rocprofiler_tracing_operation_t op) const;
uint64_t get_node_id(rocprofiler_agent_id_t _val) const;
agent_index get_agent_index(rocprofiler_agent_id_t agent, agent_indexing index) const;
const std::string* get_string_entry(size_t key) const;
private: