Skip to content

Commit ae293a2

Browse files
authored
ci: measure ipcinfo growth by its sections, not its page-rounded file size (#251)
The budget compared stat -c %s of ipcinfo before and after. That file is page-quantised: the RW segment's file offset has to equal its address modulo 4096, so it jumps a whole page whenever the code in front of it crosses a boundary. On master the code segment ends exactly where the data segment begins (0xae68 both), so the slack is zero bytes. A change adding 12 bytes of code (#249) and one adding 24 (#250) each "grew" ipcinfo by 4096 and failed the 1024-byte budget. Measure text + data + bss from size(1) instead: what the camera loads, growing by the bytes the change adds. With the CI toolchain those two PRs measure +12 and +24.
1 parent 5d678de commit ae293a2

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎.github/workflows/pr-build-check.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ jobs:
7070
# the boards use -- so an absolute ceiling here would describe no
7171
# shipped binary and would go stale the moment that URL moves. A
7272
# delta does not care which compiler measured it.
73+
#
74+
# The quantity is text + data + bss from size(1), not the file size.
75+
# The file is page-quantised: the RW segment's file offset must equal
76+
# its address modulo 4096, so it moves a whole page the moment the
77+
# code before it crosses a boundary. On 5d678de the code segment ended
78+
# exactly where the data segment began (both 0xae68), and a PR adding
79+
# 12 bytes of code grew the file by 4096 and failed the budget.
7380
if: matrix.target == 'arm32'
7481
run: |
7582
export PATH=/opt/${{ matrix.toolchain_dir }}/bin:$PATH
@@ -80,7 +87,8 @@ jobs:
8087
-DBUILD_SHARED_LIBS=ON -DSKIP_VERSION=ON \
8188
-DIPCHW_VENDORS="$2" > /dev/null
8289
cmake --build "$out" --target ipcinfo > /dev/null
83-
stat -c %s "$out/ipcinfo"
90+
cc=${{ matrix.cc }}
91+
"${cc%gcc}size" "$out/ipcinfo" | awk 'NR == 2 { print $4 }'
8492
}
8593
git worktree add -f /tmp/ipcinfo-base \
8694
"${{ github.event.pull_request.base.sha }}" > /dev/null

0 commit comments

Comments
 (0)