Repository navigation
fix(profiler): link BAMPerfProfiler with 16 KB max page size - #390
Open
shashankm03 wants to merge 1 commit into
Open
shashankm03 wants to merge 1 commit into
shashankm03 wants to merge 1 commit into
Conversation
Android 15+ devices can run with 16 KB memory pages. The shipped profiler binaries have 4 KB-aligned LOAD segments and segfault (exit 139) on such devices, so flashlight test fails at startup. Add -Wl,-z,max-page-size=16384 to the CMake target (NDK r28+ does this by default) and rebuild the four prebuilt binaries with NDK 27.1. Verified on an arm64 emulator with 16 KB pages (android-37.2 google_apis_playstore_ps16k): the old binary exits 139 on printCpuClockTick, the rebuilt one prints the clock tick.
✅ Deploy Preview for flashlight-docs canceled.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #389
Problem
On devices that use 16 KB memory pages (Android 15+ images such as
..._ps16k),flashlight testcrashes at startup:adb shell /data/local/tmp/BAMPerfProfiler printCpuClockTickexits with 139 (SIGSEGV). The prebuilt profiler binaries have 4 KB-alignedPT_LOADsegments (p_align = 0x1000), which a 16 KB-page kernel cannot map.Change
CMakeLists.txt: linkBAMPerfProfilerwith-Wl,-z,max-page-size=16384viatarget_link_options. NDK r28+ does this by default; this keeps older NDKs working too.cpp-profiler/bin/with NDK 27.1.12297006 using the existingbuild_for_abi.sh, so the diff for those files is binary.Verification
Arm64 emulator,
android-37.2;google_apis_playstore_ps16k(getconf PAGE_SIZE= 16384):printCpuClockTick100LOADsegment alignment of the rebuilt arm64 and x86_64 binaries is now 16 KB (was 4 KB).Not verified
printCpuClockTickcommand, not a fullflashlight testrun (the CLI embeds the binaries, so that needs a CLI build).yarn build, lint or the test suite.If you would rather regenerate the binaries in your own pipeline, the
CMakeLists.txtchange on its own is the fix, and the binary files can be dropped from this PR.