refactor(core): rename debug overlay to performance overlay
What changed, and why it matters
This commit is a simple rename from 'debug overlay' to 'performance overlay' across build files and Rust source code. It changes only identifiers, feature flags, and comments; no program logic or security behavior is altered. The overlay remains an optional developer-only feature that is disabled by default.
No security action needed; this is a non-functional refactor. Treat as routine code maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch renames the compile-time feature/ui_debug_overlay to ui_performance_overlay, the Makefile variable UI_DEBUG_OVERLAY to UI_PERFORMANCE_OVERLAY, the SCons argument, the Cargo feature, the Rust struct DebugOverlay to PerformanceOverlay, and the trait method render_debug_overlay to render_performance_overlay. All conditional compilation guards and call sites are updated consistently. The functionality—measuring render/refresh times and optionally drawing an on-screen overlay—remains identical and is still gated behind an off-by-default debug feature.
Changed components
core/Makefilecore/SConscript.bootloadercore/SConscript.firmwarecore/SConscript.prodtestcore/embed/rust/Cargo.tomlcore/embed/rust/src/ui/layout_bolt/mod.rscore/embed/rust/src/ui/layout_caesar/mod.rscore/embed/rust/src/ui/layout_delizia/mod.rscore/embed/rust/src/ui/layout_eckhart/mod.rscore/embed/rust/src/ui/mod.rscore/embed/rust/src/ui/shape/display/fb_rgb565.rscore/embed/rust/src/ui/shape/display/fb_rgba8888.rscore/embed/rust/src/ui/ui_common.rsInspect captured patch +69 / −57
diff --git a/core/Makefile b/core/Makefile
index 56c32767..158ecff9 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -49,7 +49,7 @@ TREZOR_EMULATOR_DEBUGGABLE ?= 0
QUIET_MODE ?= 0
TREZOR_DISABLE_ANIMATION ?= $(if $(filter 0,$(PYOPT)),1,0)
STORAGE_INSECURE_TESTING_MODE ?= 0
-UI_DEBUG_OVERLAY ?= 0
+UI_PERFORMANCE_OVERLAY ?= 0
# If set, VCP writes will be blocking, in order to allow reliable debug data transmission over VCP.
# Disabled by default, to prevent debug firmware from getting stuck while writing log messages (if the host is not reading them).
@@ -145,7 +145,7 @@ SCONS_VARS = \
TREZOR_EMULATOR_DEBUGGABLE=$(TREZOR_EMULATOR_DEBUGGABLE) \
TREZOR_MEMPERF="$(TREZOR_MEMPERF)" \
TREZOR_MODEL="$(TREZOR_MODEL)" \
- UI_DEBUG_OVERLAY="$(UI_DEBUG_OVERLAY)" \
+ UI_PERFORMANCE_OVERLAY="$(UI_PERFORMANCE_OVERLAY)" \
BLOCK_ON_VCP="$(BLOCK_ON_VCP)"
SCONS_OPTS = -Q -j $(JOBS)
diff --git a/core/SConscript.bootloader b/core/SConscript.bootloader
index b526f0eb..0f98bf75 100644
--- a/core/SConscript.bootloader
+++ b/core/SConscript.bootloader
@@ -9,7 +9,7 @@ CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
-UI_DEBUG_OVERLAY = ARGUMENTS.get('UI_DEBUG_OVERLAY', '0') == '1'
+UI_PERFORMANCE_OVERLAY = ARGUMENTS.get('UI_PERFORMANCE_OVERLAY', '0') == '1'
FEATURES_WANTED = [
"ble",
@@ -247,8 +247,8 @@ cmake_gen = env.Command(
#
features = ['bootloader',] + FEATURES_AVAILABLE + RUST_UI_FEATURES
-if UI_DEBUG_OVERLAY:
- features.append('ui_debug_overlay')
+if UI_PERFORMANCE_OVERLAY:
+ features.append('ui_performance_overlay')
rust = tools.add_rust_lib(
env=env,
diff --git a/core/SConscript.firmware b/core/SConscript.firmware
index 6c742c76..54d7541f 100644
--- a/core/SConscript.firmware
+++ b/core/SConscript.firmware
@@ -24,7 +24,7 @@ LOG_STACK_USAGE = ARGUMENTS.get('LOG_STACK_USAGE', '0') == '1'
MICROPY_ENABLE_SOURCE_LINE = ARGUMENTS.get('MICROPY_ENABLE_SOURCE_LINE', '0')
DISABLE_ANIMATION = ARGUMENTS.get('TREZOR_DISABLE_ANIMATION', '0') == '1'
BLOCK_ON_VCP = ARGUMENTS.get('BLOCK_ON_VCP', '0') == '1'
-UI_DEBUG_OVERLAY = ARGUMENTS.get('UI_DEBUG_OVERLAY', '0') == '1'
+UI_PERFORMANCE_OVERLAY = ARGUMENTS.get('UI_PERFORMANCE_OVERLAY', '0') == '1'
STORAGE_INSECURE_TESTING_MODE = ARGUMENTS.get('STORAGE_INSECURE_TESTING_MODE', '0') == '1'
if STORAGE_INSECURE_TESTING_MODE and PRODUCTION:
@@ -864,8 +864,8 @@ if PYOPT == '0':
features.append('ui_debug')
if EVERYTHING:
features.append('universal_fw')
-if UI_DEBUG_OVERLAY:
- features.append('ui_debug_overlay')
+if UI_PERFORMANCE_OVERLAY:
+ features.append('ui_performance_overlay')
rust = tools.add_rust_lib(
env=env,
diff --git a/core/SConscript.prodtest b/core/SConscript.prodtest
index 6e730daf..3a7ce440 100644
--- a/core/SConscript.prodtest
+++ b/core/SConscript.prodtest
@@ -8,7 +8,7 @@ CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
-UI_DEBUG_OVERLAY = ARGUMENTS.get('UI_DEBUG_OVERLAY', '0') == '1'
+UI_PERFORMANCE_OVERLAY = ARGUMENTS.get('UI_PERFORMANCE_OVERLAY', '0') == '1'
FEATURE_FLAGS = {
"AES_GCM": True,
@@ -310,8 +310,8 @@ if 'boot_ucb' in FEATURES_AVAILABLE:
#
features = ['prodtest',] + FEATURES_AVAILABLE + RUST_UI_FEATURES
-if UI_DEBUG_OVERLAY:
- features.append('ui_debug_overlay')
+if UI_PERFORMANCE_OVERLAY:
+ features.append('ui_performance_overlay')
rust = tools.add_rust_lib(
diff --git a/core/embed/rust/Cargo.toml b/core/embed/rust/Cargo.toml
index 0345792d..38039198 100644
--- a/core/embed/rust/Cargo.toml
+++ b/core/embed/rust/Cargo.toml
@@ -21,7 +21,7 @@ display_mono = []
display_rgb565 = ["ui_antialiasing"]
display_rgba8888 = ["ui_antialiasing"]
ui_debug = []
-ui_debug_overlay = []
+ui_performance_overlay = []
ui_antialiasing = []
ui_blurring = []
ui_image_buffer = []
diff --git a/core/embed/rust/src/ui/layout_bolt/mod.rs b/core/embed/rust/src/ui/layout_bolt/mod.rs
index c4e977a3..35dc920b 100644
--- a/core/embed/rust/src/ui/layout_bolt/mod.rs
+++ b/core/embed/rust/src/ui/layout_bolt/mod.rs
@@ -1,7 +1,7 @@
use super::{geometry::Rect, CommonUI};
-#[cfg(feature = "ui_debug_overlay")]
-use super::{shape, DebugOverlay};
+#[cfg(feature = "ui_performance_overlay")]
+use super::{shape, PerformanceOverlay};
#[cfg(feature = "bootloader")]
pub mod bootloader;
@@ -82,8 +82,11 @@ impl CommonUI for UIBolt {
fn screen_update() {}
- #[cfg(feature = "ui_debug_overlay")]
- fn render_debug_overlay<'s>(_target: &mut impl shape::Renderer<'s>, _info: DebugOverlay) {
+ #[cfg(feature = "ui_performance_overlay")]
+ fn render_performance_overlay<'s>(
+ _target: &mut impl shape::Renderer<'s>,
+ _info: PerformanceOverlay,
+ ) {
// Not implemented
}
}
diff --git a/core/embed/rust/src/ui/layout_caesar/mod.rs b/core/embed/rust/src/ui/layout_caesar/mod.rs
index 21e47ae9..1fbd828f 100644
--- a/core/embed/rust/src/ui/layout_caesar/mod.rs
+++ b/core/embed/rust/src/ui/layout_caesar/mod.rs
@@ -1,6 +1,6 @@
use super::{geometry::Rect, CommonUI};
-#[cfg(feature = "ui_debug_overlay")]
-use super::{shape, DebugOverlay};
+#[cfg(feature = "ui_performance_overlay")]
+use super::{shape, PerformanceOverlay};
#[cfg(feature = "bootloader")]
pub mod bootloader;
@@ -40,8 +40,11 @@ impl CommonUI for UICaesar {
fn screen_update() {}
- #[cfg(feature = "ui_debug_overlay")]
- fn render_debug_overlay<'s>(_target: &mut impl shape::Renderer<'s>, _info: DebugOverlay) {
+ #[cfg(feature = "ui_performance_overlay")]
+ fn render_performance_overlay<'s>(
+ _target: &mut impl shape::Renderer<'s>,
+ _info: PerformanceOverlay,
+ ) {
// Not implemented
}
}
diff --git a/core/embed/rust/src/ui/layout_delizia/mod.rs b/core/embed/rust/src/ui/layout_delizia/mod.rs
index 25e09467..3ec9545c 100644
--- a/core/embed/rust/src/ui/layout_delizia/mod.rs
+++ b/core/embed/rust/src/ui/layout_delizia/mod.rs
@@ -1,13 +1,13 @@
use super::{geometry::Rect, CommonUI};
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
use super::{
display::Color,
geometry::{Alignment, Alignment2D, Offset, Point},
- shape, DebugOverlay,
+ shape, PerformanceOverlay,
};
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
use crate::strutil::ShortString;
use theme::backlight;
@@ -88,8 +88,11 @@ impl CommonUI for UIDelizia {
fn screen_update() {}
- #[cfg(feature = "ui_debug_overlay")]
- fn render_debug_overlay<'s>(target: &mut impl shape::Renderer<'s>, info: DebugOverlay) {
+ #[cfg(feature = "ui_performance_overlay")]
+ fn render_performance_overlay<'s>(
+ target: &mut impl shape::Renderer<'s>,
+ info: PerformanceOverlay,
+ ) {
let mut text = ShortString::new();
let t1 = info.render_time.min(99999) as u32;
let t2 = info.refresh_time.min(99999) as u32;
diff --git a/core/embed/rust/src/ui/layout_eckhart/mod.rs b/core/embed/rust/src/ui/layout_eckhart/mod.rs
index 425fefa7..871bb04b 100644
--- a/core/embed/rust/src/ui/layout_eckhart/mod.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/mod.rs
@@ -1,14 +1,14 @@
use super::{geometry::Rect, CommonUI};
use theme::backlight;
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
use super::{
display::Color,
geometry::{Alignment, Alignment2D, Offset, Point},
- shape, DebugOverlay,
+ shape, PerformanceOverlay,
};
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
use crate::strutil::ShortString;
#[cfg(feature = "bootloader")]
@@ -101,8 +101,11 @@ impl CommonUI for UIEckhart {
show(&mut screen, true);
}
- #[cfg(feature = "ui_debug_overlay")]
- fn render_debug_overlay<'s>(target: &mut impl shape::Renderer<'s>, info: DebugOverlay) {
+ #[cfg(feature = "ui_performance_overlay")]
+ fn render_performance_overlay<'s>(
+ target: &mut impl shape::Renderer<'s>,
+ info: PerformanceOverlay,
+ ) {
let mut text = ShortString::new();
let t1 = info.render_time.min(99999) as u32;
let t2 = info.refresh_time.min(99999) as u32;
diff --git a/core/embed/rust/src/ui/mod.rs b/core/embed/rust/src/ui/mod.rs
index fa03dcb0..48e1f955 100644
--- a/core/embed/rust/src/ui/mod.rs
+++ b/core/embed/rust/src/ui/mod.rs
@@ -38,8 +38,8 @@ pub mod ui_firmware;
pub use ui_common::CommonUI;
-#[cfg(feature = "ui_debug_overlay")]
-pub use ui_common::DebugOverlay;
+#[cfg(feature = "ui_performance_overlay")]
+pub use ui_common::PerformanceOverlay;
cfg_if::cfg_if! {
if #[cfg(feature = "layout_bolt")] {
diff --git a/core/embed/rust/src/ui/shape/display/fb_rgb565.rs b/core/embed/rust/src/ui/shape/display/fb_rgb565.rs
index 5bf67863..3f1282a7 100644
--- a/core/embed/rust/src/ui/shape/display/fb_rgb565.rs
+++ b/core/embed/rust/src/ui/shape/display/fb_rgb565.rs
@@ -10,10 +10,10 @@ use crate::{
},
};
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
use crate::{
trezorhal::time,
- ui::{CommonUI, DebugOverlay, ModelUI},
+ ui::{CommonUI, ModelUI, PerformanceOverlay},
};
use super::bumps;
@@ -21,7 +21,7 @@ use super::bumps;
pub type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Rgb565Canvas<'alloc>>;
// Time of the last frame buffer get operation
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
static mut FRAME_BUFFER_GET_TIME: u64 = 0;
/// Creates the `Renderer` object for drawing on a display and invokes a
@@ -44,12 +44,12 @@ where
let cache = DrawingCache::new(bump_a, bump_b);
- #[cfg(feature = "ui_debug_overlay")]
+ #[cfg(feature = "ui_performance_overlay")]
let refresh_time = unsafe { time::ticks_us() - FRAME_BUFFER_GET_TIME };
let fb_info = display::get_frame_buffer();
- #[cfg(feature = "ui_debug_overlay")]
+ #[cfg(feature = "ui_performance_overlay")]
unsafe {
FRAME_BUFFER_GET_TIME = time::ticks_us()
};
@@ -74,18 +74,18 @@ where
let mut target = ScopedRenderer::new(DirectRenderer::new(&mut canvas, bg_color, &cache));
// In debug mode, measure the time spent on rendering.
- #[cfg(feature = "ui_debug_overlay")]
+ #[cfg(feature = "ui_performance_overlay")]
{
let render_time = time::measure_us(|| func(&mut target));
- let info = DebugOverlay {
+ let info = PerformanceOverlay {
render_time,
refresh_time,
};
- ModelUI::render_debug_overlay(&mut target, info);
+ ModelUI::render_performance_overlay(&mut target, info);
}
// In production, just execute the drawing function without timing.
- #[cfg(not(feature = "ui_debug_overlay"))]
+ #[cfg(not(feature = "ui_performance_overlay"))]
{
func(&mut target);
}
diff --git a/core/embed/rust/src/ui/shape/display/fb_rgba8888.rs b/core/embed/rust/src/ui/shape/display/fb_rgba8888.rs
index 75ab15d6..d09f89be 100644
--- a/core/embed/rust/src/ui/shape/display/fb_rgba8888.rs
+++ b/core/embed/rust/src/ui/shape/display/fb_rgba8888.rs
@@ -10,10 +10,10 @@ use crate::{
},
};
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
use crate::{
trezorhal::time,
- ui::{CommonUI, DebugOverlay, ModelUI},
+ ui::{CommonUI, ModelUI, PerformanceOverlay},
};
use super::bumps;
@@ -21,7 +21,7 @@ use super::bumps;
pub type ConcreteRenderer<'a, 'alloc> = DirectRenderer<'a, 'alloc, Rgba8888Canvas<'alloc>>;
// Time of the last frame buffer get operation
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
static mut FRAME_BUFFER_GET_TIME: u64 = 0;
/// Creates the `Renderer` object for drawing on a display and invokes a
@@ -44,12 +44,12 @@ where
let cache = DrawingCache::new(bump_a, bump_b);
- #[cfg(feature = "ui_debug_overlay")]
+ #[cfg(feature = "ui_performance_overlay")]
let refresh_time = unsafe { time::ticks_us() - FRAME_BUFFER_GET_TIME };
let fb_info = display::get_frame_buffer();
- #[cfg(feature = "ui_debug_overlay")]
+ #[cfg(feature = "ui_performance_overlay")]
unsafe {
FRAME_BUFFER_GET_TIME = time::ticks_us()
};
@@ -74,18 +74,18 @@ where
let mut target = ScopedRenderer::new(DirectRenderer::new(&mut canvas, bg_color, &cache));
// In debug mode, measure the time spent on rendering.
- #[cfg(feature = "ui_debug_overlay")]
+ #[cfg(feature = "ui_performance_overlay")]
{
let render_time = time::measure_us(|| func(&mut target));
- let info = DebugOverlay {
+ let info = PerformanceOverlay {
render_time,
refresh_time,
};
- ModelUI::render_debug_overlay(&mut target, info);
+ ModelUI::render_performance_overlay(&mut target, info);
}
// In production, just execute the drawing function without timing.
- #[cfg(not(feature = "ui_debug_overlay"))]
+ #[cfg(not(feature = "ui_performance_overlay"))]
{
func(&mut target);
}
diff --git a/core/embed/rust/src/ui/ui_common.rs b/core/embed/rust/src/ui/ui_common.rs
index 2388a532..5b1ece59 100644
--- a/core/embed/rust/src/ui/ui_common.rs
+++ b/core/embed/rust/src/ui/ui_common.rs
@@ -1,12 +1,12 @@
use crate::ui::geometry::Rect;
-#[cfg(feature = "ui_debug_overlay")]
+#[cfg(feature = "ui_performance_overlay")]
use crate::ui::shape::Renderer;
/// A structure containing information to be displayed in the debug overlay
-/// on the screen when the "ui_debug_overlay" feature is enabled.
-#[cfg(feature = "ui_debug_overlay")]
-pub struct DebugOverlay {
+/// on the screen when the "ui_performance_overlay" feature is enabled.
+#[cfg(feature = "ui_performance_overlay")]
+pub struct PerformanceOverlay {
/// Time (in microseconds) spent by the rendering functions.
pub render_time: u64,
@@ -47,7 +47,7 @@ pub trait CommonUI {
fn screen_update();
/// Renders a partially transparent overlay over the screen content
- /// using data from the `DebugOverlay` struct.
- #[cfg(feature = "ui_debug_overlay")]
- fn render_debug_overlay<'s>(target: &mut impl Renderer<'s>, info: DebugOverlay);
+ /// using data from the `PerformanceOverlay` struct.
+ #[cfg(feature = "ui_performance_overlay")]
+ fn render_performance_overlay<'s>(target: &mut impl Renderer<'s>, info: PerformanceOverlay);
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.