Skip to content

Commit

Permalink
CR-1219544 (#8591)
Browse files Browse the repository at this point in the history
Signed-off-by: AShivangi <[email protected]>
  • Loading branch information
AShivangi authored Nov 5, 2024
1 parent 76557ab commit 1373774
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/runtime_src/core/common/info_telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@ aie2_preemption_info(const xrt_core::device* device)
{
const auto data = xrt_core::device_query<xrt_core::query::rtos_telemetry>(device);
boost::property_tree::ptree pt_rtos_array;
int user_task = 0;

for (const auto& kp : data) {
boost::property_tree::ptree pt_preempt;

auto populate_value = [](uint64_t value) {
return (value == static_cast<uint64_t>(-1) || value == UINT64_MAX) ? "N/A" : std::to_string(value);
};
auto populate_value = [](uint64_t value) {
return (value == static_cast<uint64_t>(-1) || value == UINT64_MAX) ? "N/A" : std::to_string(value);
};

//add check if a workload is running
if(static_cast<int>(kp.preemption_data.slot_index) == -1)
continue;
pt_preempt.put("user_task", populate_value(kp.user_task));
pt_preempt.put("user_task", user_task++);
pt_preempt.put("slot_index", populate_value(kp.preemption_data.slot_index));
pt_preempt.put("preemption_flag_set", populate_value(kp.preemption_data.preemption_flag_set));
pt_preempt.put("preemption_flag_unset", populate_value(kp.preemption_data.preemption_flag_unset));
Expand Down

0 comments on commit 1373774

Please sign in to comment.