diff --git a/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp b/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp index ef466f26..58835341 100644 --- a/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp +++ b/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp @@ -192,7 +192,9 @@ namespace xdp { ptSchema.put("patch", "0"); ptHeader.add_child("schema_version", ptSchema); ptHeader.put("device", "Client"); - ptHeader.put("clock_freq_MHz", 1000); + if (!powerMode.empty()) { + ptHeader.put("power_mode", powerMode); + } ptHeader.put("id_size", sizeof(uint32_t)); ptHeader.put("cycle_size", 2*sizeof(uint32_t)); ptHeader.put("buffer_size", mBufSz); diff --git a/profile/plugin/ml_timeline/clientDev/ml_timeline.h b/profile/plugin/ml_timeline/clientDev/ml_timeline.h index d33e42e7..fed1d0c0 100644 --- a/profile/plugin/ml_timeline/clientDev/ml_timeline.h +++ b/profile/plugin/ml_timeline/clientDev/ml_timeline.h @@ -30,6 +30,7 @@ namespace xdp { { std::unique_ptr mResultBOHolder; xrt_core::bo_int::use_type mBOType; + std::string powerMode; public : MLTimelineClientDevImpl(VPDatabase* dB, uint32_t sz, @@ -39,6 +40,10 @@ namespace xdp { virtual void updateDevice(void* hwCtxImpl, uint64_t devId = 0); virtual void finishflushDevice(void* hwCtxImpl, uint64_t implId = 0); + + virtual void setPowerMode(const std::string &pMode) { + powerMode = pMode; + } }; } diff --git a/profile/plugin/ml_timeline/ml_timeline_impl.h b/profile/plugin/ml_timeline/ml_timeline_impl.h index a8a49a8b..d087eefa 100644 --- a/profile/plugin/ml_timeline/ml_timeline_impl.h +++ b/profile/plugin/ml_timeline/ml_timeline_impl.h @@ -35,6 +35,8 @@ namespace xdp { virtual void updateDevice(void*, uint64_t) = 0; virtual void finishflushDevice(void*, uint64_t) = 0; + virtual void setPowerMode(const std::string &) {} + void setHWContextName(const std::string &nm) { mHwCtxName = nm; } diff --git a/profile/plugin/ml_timeline/ml_timeline_plugin.cpp b/profile/plugin/ml_timeline/ml_timeline_plugin.cpp index edbb3fa2..05121e7a 100644 --- a/profile/plugin/ml_timeline/ml_timeline_plugin.cpp +++ b/profile/plugin/ml_timeline/ml_timeline_plugin.cpp @@ -213,6 +213,15 @@ namespace xdp { xrt_core::message::send(xrt_core::message::severity_level::debug, "XRT", msg.str()); } + try { + const auto pmode = xrt_core::device_query(coreDevice); + mlImpl->setPowerMode(xrt_core::query::performance_mode::parse_status(pmode)); + } catch (const xrt_core::query::no_such_key&) { + xrt_core::message::send(xrt_core::message::severity_level::warning, "XRT", "Failed to retrieve Power Mode"); + } catch (const std::exception &) { + xrt_core::message::send(xrt_core::message::severity_level::warning, "XRT", "Failed to retrieve Power Mode"); + } + #elif defined (XDP_VE2_BUILD) if (mMultiImpl.find(hwCtxImpl) != mMultiImpl.end()) {