Skip to content

AIESW-33855 [XRT-SMI] [AIE4] dipslay only relevant data in -telemetry and -preemption reports - #9972

Draft
AShivangi wants to merge 1 commit into
Xilinx:masterfrom
AShivangi:preemption-telemetry
Draft

AIESW-33855 [XRT-SMI] [AIE4] dipslay only relevant data in -telemetry and -preemption reports#9972
AShivangi wants to merge 1 commit into
Xilinx:masterfrom
AShivangi:preemption-telemetry

Conversation

@AShivangi

Copy link
Copy Markdown
Collaborator

Problem solved by the commit

AIESW-33855 [XRT-SMI] [AIE4] dipslay only relevant data in -telemetry and -preemption reports

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

When driver exposed the new virtual contexts, xrt-smi started displaying long reports

How problem was solved, alternative solutions (if any) and why they were rejected

When a single report is run interactively (preemption or telemetry), it clears the current screen and prints the rows that fit on the terminal.

  1. When the new behavior is triggered
    All of the following must be true:
  • A VT-capable terminal is available — i.e. ANSI/VT escape sequences can be used. If escape codes are unavailable/disabled, the behavior is off.
  • No --batch - With --batch, escape codes are disabled and the whole report is printed. This precedence was set by watch mode, and I'm following it for consistency.
  • Exactly one report is queried — a single -r telemetry or -r preemption. The fit-to-terminal trimming applies to the single-report case only.
  1. Behavior when triggered (interactive, no --batch)
    • The visible screen is cleared. This preserves scrollback.
    • We query the terminal size (rows) — GetConsoleScreenBufferInfo on Windows, ioctl(TIOCGWINSZ) on Linux — with a conservative 24×80 fallback if it can't be determined.
    • The report is trimmed to the rows that fit.

  2. Behavior when NOT triggered
    There are three cases, with two distinct outcomes:

  • (a) No VT terminal, or (b) --batch → escape codes are disabled, so the full, unmodified report is emitted: no screen clear, no truncation. This keeps redirected/scripted output complete (the watch-mode precedence).
  • (c) Multiple reports queried (e.g. -r telemetry preemption, interactive) → the screen is cleared once and a single shared device header is printed; each telemetry/preemption report is then capped at the fixed default 24-row layout (not the measured terminal size, so combined output stays stable) and followed by a truncation notice. Other reports in the same run (e.g. platform) print in full.

Risks (if any) associated the changes in the commit

It touches Report.h and XBUtilities, so it can affect examine reports. However, I have done thorough manual testing.

What has been tested and how, request additional testing if necessary

Tested on windows
Linux testing TBD

Documentation impact (if any)

Update xrt-smi User Guide

Signed-off-by: Agarwal <sagarw@amd.com>
@AShivangi
AShivangi requested review from aktondak and rchane August 6, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants