Skip to content

Commit

Permalink
CR-1155098 Missing host memory status in Platform report (#7675)
Browse files Browse the repository at this point in the history
* CR-1155098 Add host memory and data retention to platform json output

Signed-off-by: Daniel Benusovich <[email protected]>

* CR-1155098 Add better comment for host memory status

Signed-off-by: Daniel Benusovich <[email protected]>

* CR-1155098 Remove data retention from json output

Signed-off-by: Daniel Benusovich <[email protected]>

---------

Signed-off-by: Daniel Benusovich <[email protected]>
  • Loading branch information
dbenusov authored Sep 2, 2023
1 parent 71a763f commit e5a7ba8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/runtime_src/core/common/info_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ add_performance_info(const xrt_core::device* device, ptree_type& pt)
pt.add("performance_mode", xq::performance_mode::parse_status(mode));
}

void
add_host_mem_info(const xrt_core::device* device, ptree_type& pt)
{
std::string data_retention_string = "not supported";
try {
auto value = xrt_core::device_query<xrt_core::query::enabled_host_mem>(device);
data_retention_string = (value > 0 ? "enabled" : "disabled");
}
catch (xrt_core::query::exception&) {
// Device does not support host memory features
}
pt.add("host_memory_status", data_retention_string);
}

void
add_status_info(const xrt_core::device* device, ptree_type& pt)
{
Expand All @@ -163,6 +177,7 @@ add_status_info(const xrt_core::device* device, ptree_type& pt)
add_mig_info(device, pt_status);
add_p2p_info(device, pt_status);
add_performance_info(device, pt_status);
add_host_mem_info(device, pt_status);

pt.put_child("status", pt_status);
}
Expand Down

0 comments on commit e5a7ba8

Please sign in to comment.