Skip to content

[Feature]: Increase verbosity of stack traces and image loads #1427

Description

@thomashinds

Feature Overview

Currently it is hard to debug issues found on devices running release builds with a Patina binary. If the Advanced Logger header has a hw_print_level like 0x80000000 (error only), then image load (info) and call stack (warn) prints aren't logged to the serial port.

With issues like this, developers have only this info available to debug:

15:54:37.999 : ERROR - 
15:54:37.999 : ERROR - EXCEPTION: Synchronous Exception
15:54:37.999 : ERROR - 
15:54:38.000 : ERROR - Page Fault (Data Abort)
15:54:38.000 : ERROR - 
15:54:38.000 : ERROR - Exception Registers:
15:54:38.001 : ERROR -  ESR:  0x0000000096000005    ELR:  0x00000000DA1A905C   SPSR:  0x0000000060001049    FAR:  0x0000000100000E3F
15:54:38.001 : ERROR - 
15:54:38.001 : ERROR - General-Purpose Registers:
15:54:38.002 : ERROR -   x0:  0x0000000000000000     x1:  0x0000000000000000     x2:  0x0000000000000000     x3:  0x0000000000000070
15:54:38.004 : ERROR -   x4:  0x00000000D6A4F6A0     x5:  0x00000000D9EE3D51     x6:  0x0000000000000001     x7:  0x0000000000000001
15:54:38.004 : ERROR -   x8:  0x0000000000000000     x9:  0x0000000000000000    x10:  0x00000000D9EE3B28    x11:  0x0000000000000070
15:54:38.005 : ERROR -  x12:  0x0000000000000070    x13:  0x00000000D9EE3B98    x14:  0x0A0D303445303030    x15:  0x0000000000000001
15:54:38.006 : ERROR -  x16:  0x0000000000000000    x17:  0x0000000000000000    x18:  0x0000000000000000    x19:  0x0000000000200001
15:54:38.007 : ERROR -  x20:  0x00000000FFCC1A18    x21:  0x00000000FFFFFFFF    x22:  0x0000000002000310    x23:  0x0000000100000E3F
15:54:38.007 : ERROR -  x24:  0x0000000000000048    x25:  0x00000000DA1B6000    x26:  0x800000000000000E    x27:  0x00000000DA1B6000
15:54:38.008 : ERROR -  x28:  0x0000000000000002     fp:  0x00000000D9EE3F10     lr:  0x00000000DA1A905C     sp:  0x00000000D9EE3C60
15:54:38.008 : ERROR - 
15:54:38.008 : ERROR - 
15:54:38.008 : ERROR - Dumping Exception Stack Trace:
15:54:38.009 : ERROR - StackTrace: `<module name redacted>` does not contain an exception directory. Trying fp/lr based stack trace instead.
15:54:38.009 : ERROR - 
15:54:38.010 : ERROR - EXCEPTION: Synchronous Exception
15:54:38.010 : ERROR - 
15:54:38.010 : ERROR - Page Fault (Data Abort)
15:54:38.010 : ERROR - 
15:54:38.010 : ERROR - Exception Registers:
15:54:38.011 : ERROR -  ESR:  0x0000000096000006    ELR:  0x00000000D6AA1C44   SPSR:  0x00000000200013C8    FAR:  0x00000000A6BFF000
15:54:38.011 : ERROR - 
15:54:38.011 : ERROR - General-Purpose Registers:
15:54:38.012 : ERROR -   x0:  0x00000000D6AF5978     x1:  0x00000000A7005E58     x2:  0x0000000000000006     x3:  0x000000000000006A
15:54:38.013 : ERROR -   x4:  0x0000000000000002     x5:  0x0000000000000004     x6:  0x0000000100000E3F     x7:  0x00000000D9EE3C60
15:54:38.013 : ERROR -   x8:  0x000000000000BF88     x9:  0x0000000000005A4D    x10:  0x0000000000004550    x11:  0x00000000D6B18CBE
15:54:38.014 : ERROR -  x12:  0x0000000000000068    x13:  0x00000000D6AF5778    x14:  0x4543432B62313732    x15:  0x0000000000000001
15:54:38.015 : ERROR -  x16:  0x0000000000000000    x17:  0x0000000000000000    x18:  0x0000000000000000    x19:  0x00000000D6AF5978
15:54:38.016 : ERROR -  x20:  0x00000000A7005E58    x21:  0x00000000A6BFF000    x22:  0x00000000D6AF6000    x23:  0x0000000000000005
15:54:38.017 : ERROR -  x24:  0x000000000000001D    x25:  0x00000000D6A5458C    x26:  0x00000000D6AE17D8    x27:  0x000000000000000B
15:54:38.018 : ERROR -  x28:  0x0000000000000005     fp:  0x00000000D9EE3F10     lr:  0x00000000D6AA1964     sp:  0x00000000D9EE3C60
15:54:38.018 : ERROR - 
15:54:38.018 : ERROR - 
15:54:38.018 : ERROR - Dumping Exception Stack Trace:
15:54:38.018 : ERROR - StackTrace: Failed to locate a PE Image in memory with rip: 1F

Solution Overview

Increase the verbosity of these prints to error:

At least for the image load print, apply to a specific target so platforms can still suppress these prints if desired. Possibly for stack trace as well.

Alternatives Considered

  • Increase platform serial log verbosity from 0x80000000 - not desirable because we don't want all info/warn level prints from all modules
  • Implement broader configurability of hw_print_level perhaps allowing specifying a bitmask override on a per-log-target basis (I will open an issue for this as well)
  • Just use the file log or memory log. This is a good workaround to have, but historically UEFI serial logs are a crucial tool for quickly diagnosing and debugging issues.

Urgency

Medium

Are you going to implement the feature request?

I will implement the feature

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

No response

Activity

  1. moved this to Backlog in Patinaon May 27, 2026
  2. makubacki commented on May 27, 2026

    @makubacki
    Collaborator

    @thomashinds, I've made you the owner since you selected "I will implement this issue".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions