From 1838b256f5ea5e517d7e48eab888d61201ab1174 Mon Sep 17 00:00:00 2001 From: Garima Dhaked Date: Wed, 25 Feb 2026 15:33:01 +0530 Subject: [PATCH] Added Warning in ML Timeline plugin if no microcontroller section in aie trace metadata Signed-off-by: Garima Dhaked --- profile/plugin/ml_timeline/clientDev/ml_timeline.cpp | 7 +++++++ profile/plugin/ml_timeline/ve2/ml_timeline.cpp | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp b/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp index 1d9f872c..e570ac48 100644 --- a/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp +++ b/profile/plugin/ml_timeline/clientDev/ml_timeline.cpp @@ -106,6 +106,13 @@ namespace xdp { xrt_core::message::send(xrt_core::message::severity_level::debug, "XRT", numSegmentMsg.str()); } + /* Skip buffer creation when size is 0 (e.g. AIE trace metadata present but no microcontroller section). */ + if (mBufSz == 0 || mNumBufSegments == 0) { + xrt_core::message::send(xrt_core::message::severity_level::debug, "XRT", + "ML Timeline skipped: result buffer size is 0 (no microcontroller section). Cannot get ML Timeline info."); + return; + } + try { /* Use a container for Debug BO for results to control its lifetime. diff --git a/profile/plugin/ml_timeline/ve2/ml_timeline.cpp b/profile/plugin/ml_timeline/ve2/ml_timeline.cpp index 43ba61e9..a7d7c0dc 100644 --- a/profile/plugin/ml_timeline/ve2/ml_timeline.cpp +++ b/profile/plugin/ml_timeline/ve2/ml_timeline.cpp @@ -106,6 +106,12 @@ namespace xdp { xrt_core::message::send(xrt_core::message::severity_level::debug, "XRT", numSegmentMsg.str()); } + /* Skip buffer creation when size is 0 (e.g. AIE trace metadata present but no microcontroller section). */ + if (mBufSz == 0 || mNumBufSegments == 0) { + xrt_core::message::send(xrt_core::message::severity_level::debug, "XRT", + "ML Timeline skipped: result buffer size is 0 (no microcontroller section). Cannot get ML Timeline info."); + return; + } try { mResultBOHolder = std::make_unique(hwCtxImpl, mBufSz); memset(mResultBOHolder->map(), 0, mBufSz);