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

Remove error erasures #8272

Merged
merged 3 commits into from
Jul 14, 2021
Merged

Conversation

kpschoedel
Copy link
Contributor

Problem

Various code of the form

error = chipf();
Verify(error != CHIP_NO_ERROR, error = CHIP_OTHER_ERROR)

simply discards an error and replaces it with another, usually
CHIP_ERROR_INTERNAL. This has two problems:

  • on small platforms, it uses extra code;
  • on large platforms, it is planned that the CHIP_ERROR type will
    track the original source location of the error, and throwing
    this away will impede troubleshooting.

Change overview

Use the original error code instead of replacing it.

Testing

No affected tests check for specific error codes. Unit tests should
be expected to catch any unintended changes to functionality.

@kpschoedel kpschoedel changed the title Remove error erasures WIP: Remove error erasures Jul 10, 2021
@kpschoedel
Copy link
Contributor Author

Marking WIP because this depends on #8179

@github-actions
Copy link

Size increase report for "nrfconnect-example-build" from 0e19e0d

File Section File VM
chip-lock.elf device_handles 8 8
chip-lock.elf text -136 -136
chip-shell.elf text -32 -32
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-lock.elf and ./pull_artifact/chip-lock.elf:

sections,vmsize,filesize
.debug_info,0,1203
.debug_loc,0,304
.debug_abbrev,0,151
.debug_ranges,0,104
device_handles,8,8
.debug_frame,0,-4
text,-136,-136
.debug_line,0,-374

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_info,0,215
.debug_loc,0,176
.debug_line,0,45
.debug_abbrev,0,12
text,-32,-32
.debug_ranges,0,-96


@kpschoedel kpschoedel changed the title WIP: Remove error erasures Remove error erasures Jul 12, 2021
@github-actions
Copy link

Size increase report for "gn_qpg-example-build" from c1629cc

File Section File VM
chip-qpg6100-lighting-example.out .text -112 -112
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-qpg6100-lighting-example.out and ./pull_artifact/chip-qpg6100-lighting-example.out:

sections,vmsize,filesize
.debug_info,0,1205
.debug_loc,0,300
.debug_abbrev,0,153
[Unmapped],0,112
.debug_ranges,0,104
.debug_str,0,1
.debug_frame,0,-4
.text,-112,-112
.debug_line,0,-355

Comparing ./master_artifact/chip-qpg6100-lighting-example.out.map and ./pull_artifact/chip-qpg6100-lighting-example.out.map:

BLOAT EXECUTION FAILED WITH CODE 1:
bloaty: unknown file type for file './pull_artifact/chip-qpg6100-lighting-example.out.map'


@bzbarsky-apple
Copy link
Contributor

@kpschoedel Build failures?

@github-actions
Copy link

Size increase report for "esp32-example-build" from c1629cc

File Section File VM
chip-lock-app.elf .flash.text -112 -112
chip-temperature-measurement-app.elf .flash.text -44 -44
chip-all-clusters-app.elf .flash.text -68 -68
chip-shell.elf .flash.text -100 -100
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-lock-app.elf and ./pull_artifact/chip-lock-app.elf:

sections,vmsize,filesize
.debug_info,0,837
.debug_loc,0,195
[Unmapped],0,112
.debug_ranges,0,72
.debug_abbrev,0,56
.debug_str,0,-2
.flash.text,-112,-112
.debug_line,0,-826

Comparing ./master_artifact/chip-temperature-measurement-app.elf and ./pull_artifact/chip-temperature-measurement-app.elf:

sections,vmsize,filesize
.debug_info,0,1030
.debug_abbrev,0,79
[Unmapped],0,44
.debug_str,0,-1
.debug_ranges,0,-16
.flash.text,-44,-44
.debug_loc,0,-109
.debug_line,0,-675

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_info,0,1013
.debug_loc,0,191
.debug_ranges,0,72
[Unmapped],0,68
.debug_abbrev,0,56
.xt.prop._ZN4chip11DeviceLayer8Internal26GenericPlatformManagerImplINS0_19PlatformManagerImplEE14_InitChipStackEv,0,40
.debug_str,0,2
.xt.prop._ZN4chip11DeviceLayer8Internal35GenericPlatformManagerImpl_FreeRTOSINS0_19PlatformManagerImplEE15_StartChipTimerEj,0,-12
.xt.lit._ZN4chip11DeviceLayer8Internal35GenericPlatformManagerImpl_FreeRTOSINS0_19PlatformManagerImplEE15_StartChipTimerEj,0,-48
.flash.text,-68,-68
.debug_line,0,-826

Comparing ./master_artifact/chip-persistent-storage.elf and ./pull_artifact/chip-persistent-storage.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_info,0,197
.debug_loc,0,171
[Unmapped],0,100
.debug_str,0,-2
.debug_ranges,0,-8
.debug_line,0,-10
.flash.text,-100,-100


#### Problem

Various code of the form

    error = chipf();
    Verify(error != CHIP_NO_ERROR, error = CHIP_OTHER_ERROR)

simply discards an error and replaces it with another, usually
CHIP_ERROR_INTERNAL. This has two problems:

- on small platforms, it uses extra code;
- on large platforms, it is planned that the CHIP_ERROR type will
  track the original source location of the error, and throwing
  this away will impede troubleshooting.

#### Change overview

Use the original error code instead of replacing it.

#### Testing

No affected tests check for specific error codes. Unit tests should
be expected to catch any unintended changes to functionality.
@bzbarsky-apple bzbarsky-apple merged commit e922686 into project-chip:master Jul 14, 2021
@kpschoedel kpschoedel deleted the error-erasure branch July 14, 2021 13:46
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
* Remove error erasures

#### Problem

Various code of the form

    error = chipf();
    Verify(error != CHIP_NO_ERROR, error = CHIP_OTHER_ERROR)

simply discards an error and replaces it with another, usually
CHIP_ERROR_INTERNAL. This has two problems:

- on small platforms, it uses extra code;
- on large platforms, it is planned that the CHIP_ERROR type will
  track the original source location of the error, and throwing
  this away will impede troubleshooting.

#### Change overview

Use the original error code instead of replacing it.

#### Testing

No affected tests check for specific error codes. Unit tests should
be expected to catch any unintended changes to functionality.

* build fixes

* build fixes
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.

6 participants