From 88e2be483556cd6d273197ab14cf953834496a27 Mon Sep 17 00:00:00 2001 From: Richard Byron Date: Tue, 21 Apr 2026 10:58:12 -0700 Subject: [PATCH 1/3] Free trace buffers --- profile/device/aie_trace/aie_trace_offload.cpp | 5 +++-- profile/device/hal_device/xdp_hal_device.cpp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/profile/device/aie_trace/aie_trace_offload.cpp b/profile/device/aie_trace/aie_trace_offload.cpp index 789e5a71..b020f6b4 100644 --- a/profile/device/aie_trace/aie_trace_offload.cpp +++ b/profile/device/aie_trace/aie_trace_offload.cpp @@ -40,7 +40,7 @@ namespace xdp { - + AIETraceOffload::AIETraceOffload ( void* handle, uint64_t id , PLDeviceIntf* dInt @@ -487,7 +487,8 @@ void AIETraceOffload::startOffload() void AIETraceOffload::continuousOffload() { - if (!bufferInitialized && !initReadTrace()) { + if (!bufferInitialized) { + // initReadTrace failed to allocate the buffer, cannot offload offloadFinished(); return; } diff --git a/profile/device/hal_device/xdp_hal_device.cpp b/profile/device/hal_device/xdp_hal_device.cpp index 4113002a..27c969b4 100644 --- a/profile/device/hal_device/xdp_hal_device.cpp +++ b/profile/device/hal_device/xdp_hal_device.cpp @@ -208,7 +208,9 @@ size_t HalDevice::alloc(size_t size, uint64_t memoryIndex) void HalDevice::free(size_t) { - return; + if(!id) return; + size_t boIndex = id - 1; + xrt_bos[boIndex] = xrt::bo(); } void* HalDevice::map(size_t id) From e43dab65a70f27b700796a2795e1ccaf88f337b7 Mon Sep 17 00:00:00 2001 From: Richard Byron Date: Tue, 21 Apr 2026 11:00:29 -0700 Subject: [PATCH 2/3] Removing whitespace change --- profile/device/aie_trace/aie_trace_offload.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/profile/device/aie_trace/aie_trace_offload.cpp b/profile/device/aie_trace/aie_trace_offload.cpp index b020f6b4..0b98667c 100644 --- a/profile/device/aie_trace/aie_trace_offload.cpp +++ b/profile/device/aie_trace/aie_trace_offload.cpp @@ -40,7 +40,6 @@ namespace xdp { - AIETraceOffload::AIETraceOffload ( void* handle, uint64_t id , PLDeviceIntf* dInt From 1028038b4660d2fe876533f51a9c40b6637b7376 Mon Sep 17 00:00:00 2001 From: Richard Byron Date: Tue, 21 Apr 2026 11:01:56 -0700 Subject: [PATCH 3/3] Removing whitespace change take 2 --- profile/device/aie_trace/aie_trace_offload.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/profile/device/aie_trace/aie_trace_offload.cpp b/profile/device/aie_trace/aie_trace_offload.cpp index 0b98667c..3124c256 100644 --- a/profile/device/aie_trace/aie_trace_offload.cpp +++ b/profile/device/aie_trace/aie_trace_offload.cpp @@ -40,6 +40,7 @@ namespace xdp { + AIETraceOffload::AIETraceOffload ( void* handle, uint64_t id , PLDeviceIntf* dInt