Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Optimize generated glib D-Bus integration stubs #37492

Merged
merged 6 commits into from
Feb 13, 2025

Conversation

arkq
Copy link
Contributor

@arkq arkq commented Feb 10, 2025

Problem

The OpenThread and wpa_supplicant auto-generated D-Bus stubs contain not used methods and properties which bloat final exec.

Changes

  • Simplify namespace for OpenThread and wpa_supplicant D-Bus codegen API
  • Strip unused methods and props

Testing

Tested locally:

OpenThread optimization saves:
.text -> 16980 bytes
.data -> 4720 bytes

wpa_supplicant optimization saves:
.text -> 69969 bytes
.data -> 16384 bytes

CI should also verify that, and check for potential breaks.

@arkq arkq requested a review from joonhaengHeo as a code owner February 10, 2025 14:04
Copy link

semanticdiff-com bot commented Feb 10, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/platform/Linux/dbus/wpa/DBusWpaNetwork.xml  17% smaller
  src/platform/Linux/dbus/wpa/DBusWpaBss.xml  12% smaller
  src/platform/Linux/dbus/wpa/DBusWpa.xml  7% smaller
  src/platform/Linux/dbus/wpa/DBusWpaInterface.xml  2% smaller
  src/controller/python/chip/ble/LinuxImpl.cpp Unsupported file format
  src/platform/Linux/ConnectivityManagerImpl.cpp Unsupported file format
  src/platform/Linux/ConnectivityManagerImpl.h Unsupported file format
  src/platform/Linux/ThreadStackManagerImpl.cpp Unsupported file format
  src/platform/Linux/ThreadStackManagerImpl.h Unsupported file format
  src/platform/Linux/bluez/AdapterIterator.cpp Unsupported file format
  src/platform/Linux/bluez/AdapterIterator.h Unsupported file format
  src/platform/Linux/bluez/BluezAdvertisement.cpp Unsupported file format
  src/platform/Linux/bluez/BluezAdvertisement.h Unsupported file format
  src/platform/Linux/bluez/BluezConnection.cpp Unsupported file format
  src/platform/Linux/bluez/BluezConnection.h Unsupported file format
  src/platform/Linux/bluez/BluezEndpoint.cpp Unsupported file format
  src/platform/Linux/bluez/BluezEndpoint.h Unsupported file format
  src/platform/Linux/bluez/BluezObjectIterator.h Unsupported file format
  src/platform/Linux/bluez/BluezObjectList.h Unsupported file format
  src/platform/Linux/bluez/BluezObjectManager.cpp Unsupported file format
  src/platform/Linux/bluez/ChipDeviceScanner.h Unsupported file format
  src/platform/Linux/bluez/Types.h Unsupported file format
  src/platform/Linux/dbus/bluez/BUILD.gn Unsupported file format
  src/platform/Linux/dbus/bluez/DBusBluez.xml  0% smaller
  src/platform/Linux/dbus/openthread/BUILD.gn Unsupported file format
  src/platform/Linux/dbus/openthread/DBusOpenthread.xml  0% smaller
  src/platform/Linux/dbus/openthread/introspect.xml  0% smaller
  src/platform/Linux/dbus/wpa/BUILD.gn Unsupported file format
  src/platform/NuttX/ThreadStackManagerImpl.h Unsupported file format
  src/platform/webos/ThreadStackManagerImpl.h Unsupported file format

Copy link

github-actions bot commented Feb 10, 2025

PR #37492: Size comparison from e86768b to ec34a8b

Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section e86768b ec34a8b change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1094776 1094776 0 0.0
RAM 103354 103354 0 0.0
bl702 lighting-app bl702+eth FLASH 650604 650604 0 0.0
RAM 25273 25273 0 0.0
bl702+wifi FLASH 828306 828306 0 0.0
RAM 13981 13981 0 0.0
bl706+mfd+rpc+littlefs FLASH 1057820 1057820 0 0.0
RAM 23885 23885 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 888506 888506 0 0.0
RAM 18496 18496 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 971548 971548 0 0.0
RAM 16360 16360 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 838452 838452 0 0.0
RAM 123480 123480 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 823864 823864 0 0.0
RAM 125360 125360 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 771024 771024 0 0.0
RAM 113820 113820 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 755292 755292 0 0.0
RAM 114028 114028 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 538926 538926 0 0.0
RAM 205208 205208 0 0.0
lock CC3235SF_LAUNCHXL FLASH 572806 572806 0 0.0
RAM 205360 205360 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 679801 679801 0 0.0
RAM 78548 78548 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 699653 699653 0 0.0
RAM 81188 81188 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 699653 699653 0 0.0
RAM 81188 81188 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 656593 656593 0 0.0
RAM 73616 73616 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 616153 616153 0 0.0
RAM 71532 71532 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 635789 635789 0 0.0
RAM 74076 74076 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 635789 635789 0 0.0
RAM 74076 74076 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 635649 635649 0 0.0
RAM 74540 74540 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 655365 655365 0 0.0
RAM 77084 77084 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 655365 655365 0 0.0
RAM 77084 77084 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 612073 612073 0 0.0
RAM 68628 68628 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 631933 631933 0 0.0
RAM 71268 71268 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 631933 631933 0 0.0
RAM 71268 71268 0 0.0
efr32 lock-app BRD4187C FLASH 937120 937120 0 0.0
RAM 159904 159904 0 0.0
BRD4338a FLASH 730516 730516 0 0.0
RAM 234716 234716 0 0.0
window-app BRD4187C FLASH 1029808 1029808 0 0.0
RAM 128008 128008 0 0.0
esp32 all-clusters-app c3devkit DRAM 97312 97312 0 0.0
FLASH 1577572 1577572 0 0.0
IRAM 83820 83820 0 0.0
m5stack DRAM 116100 116100 0 0.0
FLASH 1545374 1545374 0 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4760 4712 -48 -1.0
FLASH 2709835 2649989 -59846 -2.2
RAM 132784 111600 -21184 -16.0
all-clusters-app debug unknown 5568 5520 -48 -0.9
FLASH 5976330 5916452 -59878 -1.0
RAM 531600 510416 -21184 -4.0
all-clusters-minimal-app debug unknown 5464 5416 -48 -0.9
FLASH 5323874 5263996 -59878 -1.1
RAM 242712 221528 -21184 -8.7
bridge-app debug unknown 5480 5432 -48 -0.9
FLASH 4682390 4622544 -59846 -1.3
RAM 221448 200264 -21184 -9.6
chip-tool debug unknown 6120 6088 -32 -0.5
FLASH 13099986 13071996 -27990 -0.2
RAM 596578 596482 -96 -0.0
chip-tool-ipv6only arm64 unknown 21816 21816 0 0.0
FLASH 11163392 11138912 -24480 -0.2
RAM 648256 648160 -96 -0.0
fabric-admin debug unknown 5808 5776 -32 -0.6
FLASH 11389003 11361013 -27990 -0.2
RAM 596362 596266 -96 -0.0
fabric-bridge-app debug unknown 4736 4680 -56 -1.2
FLASH 4507712 4447866 -59846 -1.3
RAM 208632 187480 -21152 -10.1
fabric-sync debug unknown 4976 4936 -40 -0.8
FLASH 5613989 5564821 -49168 -0.9
RAM 483504 467024 -16480 -3.4
lighting-app debug+rpc+ui unknown 6144 6096 -48 -0.8
FLASH 5630465 5570625 -59840 -1.1
RAM 231792 210608 -21184 -9.1
lock-app debug unknown 5416 5384 -32 -0.6
FLASH 4731818 4682620 -49198 -1.0
RAM 207696 191216 -16480 -7.9
ota-provider-app debug unknown 4776 4720 -56 -1.2
FLASH 4360820 4300974 -59846 -1.4
RAM 201336 180184 -21152 -10.5
ota-requestor-app debug unknown 4728 4672 -56 -1.2
FLASH 4498228 4438382 -59846 -1.3
RAM 205920 184768 -21152 -10.3
shell debug unknown 4256 4216 -40 -0.9
FLASH 3006572 2951164 -55408 -1.8
RAM 160552 144040 -16512 -10.3
thermostat-no-ble arm64 unknown 9512 9512 0 0.0
FLASH 4097752 4041144 -56608 -1.4
RAM 246024 228528 -17496 -7.1
tv-app debug unknown 5744 5712 -32 -0.6
FLASH 5952901 5903717 -49184 -0.8
RAM 606904 590424 -16480 -2.7
tv-casting-app debug unknown 5320 5288 -32 -0.6
FLASH 11272749 11244541 -28208 -0.3
RAM 710864 710640 -224 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 907584 907584 0 0.0
RAM 142411 142411 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 902052 902052 0 0.0
RAM 124755 124755 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 846108 846108 0 0.0
RAM 141339 141339 0 0.0
nxp contact k32w0+release FLASH 584792 584792 0 0.0
RAM 70876 70876 0 0.0
mcxw71+release FLASH 600232 600232 0 0.0
RAM 63096 63096 0 0.0
light k32w0+release FLASH 611084 611084 0 0.0
RAM 70268 70268 0 0.0
k32w1+release FLASH 685544 685544 0 0.0
RAM 48680 48680 0 0.0
lock mcxw71+release FLASH 749056 749056 0 0.0
RAM 67500 67500 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646980 1646980 0 0.0
RAM 211576 211576 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1553660 1553660 0 0.0
RAM 208392 208392 0 0.0
light cy8ckit_062s2_43012 FLASH 1469604 1469604 0 0.0
RAM 200368 200368 0 0.0
lock cy8ckit_062s2_43012 FLASH 1467540 1467540 0 0.0
RAM 224704 224704 0 0.0
qpg lighting-app qpg6105+debug FLASH 662356 662356 0 0.0
RAM 105220 105220 0 0.0
lock-app qpg6105+debug FLASH 620152 620152 0 0.0
RAM 99664 99664 0 0.0
stm32 light STM32WB5MM-DK FLASH 483024 483024 0 0.0
RAM 144688 144688 0 0.0
telink bridge-app tl7218x FLASH 665308 665308 0 0.0
RAM 90828 90828 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 622168 622168 0 0.0
RAM 31500 31500 0 0.0
light-app-ota-shell-factory-data tl3218x FLASH 770954 770954 0 0.0
RAM 43568 43568 0 0.0
tl7218x FLASH 779456 779456 0 0.0
RAM 98704 98704 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 680770 680770 0 0.0
RAM 52192 52192 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 709322 709322 0 0.0
RAM 73400 73400 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 626264 626264 0 0.0
RAM 142032 142032 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 814102 814102 0 0.0
RAM 99608 99608 0 0.0
tizen all-clusters-app arm unknown 5104 5104 0 0.0
FLASH 1752600 1752600 0 0.0
RAM 93508 93508 0 0.0
chip-tool-ubsan arm unknown 11396 11396 0 0.0
FLASH 18686646 18686646 0 0.0
RAM 8183340 8183340 0 0.0

@mergify mergify bot merged commit 96bf5df into project-chip:master Feb 13, 2025
71 checks passed
@arkq arkq deleted the dbus-optim branch February 14, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants