Skip to content

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

Open
AShivangi wants to merge 7 commits into
Xilinx:masterfrom
AShivangi:preemption-telemetry
Open

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

Conversation

@AShivangi

@AShivangi AShivangi commented Aug 6, 2026

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.

Behavior:

xrt-smi examine -r platform  #unchanged
xrt-smi examine -r preemption #table fits terminal size
xrt-smi examine -r telemetry #table fits terminal size
xrt-smi examine -r platform telemetry preemption aie-partitions #prints all reports, telemetry and preemption reports show 16 entries followed by a note that the report is truncated"
xrt-smi examine -r telemetry --batch #prints full report
xrt-smi examine -r preemption --batch #prints full report

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
@AShivangi
AShivangi marked this pull request as ready for review August 12, 2026 17:15

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/runtime_src/core/common/detail/linux/sysinfo.h
Comment thread src/runtime_src/core/tools/common/reports/ReportPreemption.h Outdated
Comment thread src/runtime_src/core/tools/common/reports/ReportTelemetry.h Outdated
Drop redundant 'virtual' on overridden clearScreenBeforeReports() in ReportPreemption.h and ReportTelemetry.h, and suppress the unavoidable ioctl vararg warning in linux/sysinfo.h.

Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/runtime_src/core/common/detail/linux/sysinfo.h
AShivangi and others added 2 commits August 12, 2026 10:55
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Agarwal <sagarw@amd.com>
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

2 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

I, Agarwal <sagarw@amd.com>, hereby add my Signed-off-by to this commit: 5628fdf

I, Agarwal <sagarw@amd.com>, hereby add my Signed-off-by to this commit: 3f5029e

Signed-off-by: Agarwal <sagarw@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Agarwal <sagarw@amd.com>
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

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.

3 participants