Skip to content

MsGraphicsPkg: Use verbose logging for QR encoding traces - #949

Closed
Lee HoJoon (guosasipo) wants to merge 1 commit into
microsoft:release/202608from
guosasipo:qr-encoder-verbose-traces
Closed

Lee HoJoon (guosasipo) wants to merge 1 commit into
microsoft:release/202608from
guosasipo:qr-encoder-verbose-traces

Conversation

@guosasipo

Copy link
Copy Markdown

Description

QrEncoderLib emits routine algorithm and progress diagnostics at DEBUG_INFO even when the caller passes Flags = 0. When a firmware application exports AdvancedLogger through rotating QR codes, rendering each page adds these diagnostics to the same buffer. Reopening the viewer then exports its own encoding trace, causing rapid page-count growth.

Move unconditional version, masking, penalty, format/version-bit and progress traces to DEBUG_VERBOSE. Pass the level through the private PrintBinary helper so explicitly requested QR_FLAGS_DEBUG_* output remains at DEBUG_INFO. Preserve DEBUG_ERROR and invalid-input diagnostics. No encoding algorithm or public API changes.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • An out-of-tree host harness compiled the actual encoder and Mu PrintLib before and after this change. Three 752-byte, Flags = 0 inputs produced 200–220 INFO records (6,663–7,379 text bytes) per QR before the change and zero afterward; bitmap hashes matched.
  • Explicit QR_FLAGS_DEBUG_ENCODING still produced INFO output; enabling DEBUG_VERBOSE recovered the routine trace. Invalid-input ERROR output was retained.
  • Built and ran AArch64 DEBUG firmware on hardware. The viewer previously grew from tens to thousands of pages; repeated entry after the fix stayed at 63 pages in the comparison test. A subsequently received boot log contained no routine QR encoding traces.
  • Checked with TianoCore Uncrustify 73.0.11 and the Mu Basecore configuration; no formatting differences.

The host regression harness is not included in this focused source-only change.

Integration Instructions

Enable DEBUG_VERBOSE when routine encoding traces are needed. Existing explicit QR debug flags remain supported.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 21:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@guosasipo
Lee HoJoon (guosasipo) deleted the qr-encoder-verbose-traces branch October 27, 2026 21:23
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