mirror of
https://github.com/esphome/esphome.git
synced 2025-10-21 03:03:50 +01:00
tweak
This commit is contained in:
@@ -137,21 +137,21 @@ def run_detailed_analysis(build_dir: str) -> dict | None:
|
||||
|
||||
# Convert to JSON-serializable format
|
||||
result = {
|
||||
"components": {},
|
||||
"components": {
|
||||
name: {
|
||||
"text": mem.text_size,
|
||||
"rodata": mem.rodata_size,
|
||||
"data": mem.data_size,
|
||||
"bss": mem.bss_size,
|
||||
"flash_total": mem.flash_total,
|
||||
"ram_total": mem.ram_total,
|
||||
"symbol_count": mem.symbol_count,
|
||||
}
|
||||
for name, mem in components.items()
|
||||
},
|
||||
"symbols": {},
|
||||
}
|
||||
|
||||
for name, mem in components.items():
|
||||
result["components"][name] = {
|
||||
"text": mem.text_size,
|
||||
"rodata": mem.rodata_size,
|
||||
"data": mem.data_size,
|
||||
"bss": mem.bss_size,
|
||||
"flash_total": mem.flash_total,
|
||||
"ram_total": mem.ram_total,
|
||||
"symbol_count": mem.symbol_count,
|
||||
}
|
||||
|
||||
# Build symbol map
|
||||
for section in analyzer.sections.values():
|
||||
for symbol_name, size, _ in section.symbols:
|
||||
|
@@ -303,16 +303,18 @@ def detect_memory_impact_config(
|
||||
# Check if component has tests for any preferred platform
|
||||
for test_file in test_files:
|
||||
parts = test_file.stem.split(".")
|
||||
if len(parts) >= 2:
|
||||
platform = parts[1]
|
||||
if platform in PLATFORM_PREFERENCE:
|
||||
components_with_tests.append(component)
|
||||
# Select the most preferred platform across all components
|
||||
if selected_platform is None or PLATFORM_PREFERENCE.index(
|
||||
platform
|
||||
) < PLATFORM_PREFERENCE.index(selected_platform):
|
||||
selected_platform = platform
|
||||
break
|
||||
if len(parts) < 2:
|
||||
continue
|
||||
platform = parts[1]
|
||||
if platform not in PLATFORM_PREFERENCE:
|
||||
continue
|
||||
components_with_tests.append(component)
|
||||
# Select the most preferred platform across all components
|
||||
if selected_platform is None or PLATFORM_PREFERENCE.index(
|
||||
platform
|
||||
) < PLATFORM_PREFERENCE.index(selected_platform):
|
||||
selected_platform = platform
|
||||
break
|
||||
|
||||
# If no components have tests, don't run memory impact
|
||||
if not components_with_tests:
|
||||
|
Reference in New Issue
Block a user