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

armbian-kernel.sh: introduce KERNEL_BTF=no to opt-out of BTF/CO-RE type-info on low-RAM machines #7675

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rpardini
Copy link
Member

@rpardini rpardini commented Jan 8, 2025

armbian-kernel.sh: introduce KERNEL_BTF=no to opt-out of BTF/CO-RE type-info on low-RAM machines

  • armbian-kernel.sh: introduce KERNEL_BTF=no to opt-out of BTF/CO-RE type-info on low-RAM machines
    • turns out pahole for vmlinux can take multiple gigabytes of RAM to run successfully
    • I can't simply decide based on available RAM, as that would make .config hashes mismatch
    • thus, introduce:
      • default is to enable BTF; if on low-ram host, error out unless KERNEL_BTF=yes is passed
      • if KERNEL_BTF=no is passed, the BTF debug info is always disabled
      • if KERNEL_BTF=yes is passed, then a warning is produced, but BTF is still enabled
    • the magic number "6451 MiB" was determined empirically (and is probably bs)

…type-info on low-RAM machines

- turns out `pahole` for `vmlinux` can take multiple gigabytes of RAM to run successfully
- I can't simply decide based on available RAM, as that would make .config hashes mismatch
- thus, introduce:
  - default is to enable BTF; if on low-ram host, error out unless KERNEL_BTF=yes is passed
  - if KERNEL_BTF=no is passed, the BTF debug info is always disabled
  - if KERNEL_BTF=yes is passed, then a warning is produced, but BTF is still enabled
- the magic number "6451 MiB" was determined empirically (and is probably bs)
@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Framework Framework components labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Framework components Needs review Seeking for review size/medium PR with more then 50 and less then 250 lines
Development

Successfully merging this pull request may close these issues.

1 participant