Skip to content

Conversation

hodgesds
Copy link
Contributor

See the docs for __kconfig[1], on some systems if __weak is not used it can cause libbpf to error out on loading.

[1] https://docs.ebpf.io/ebpf-library/libbpf/ebpf/__kconfig/

See the docs for __kconfig[1], on some systems if __weak is not used it can
cause libbpf to error out on loading.

  [1] https://docs.ebpf.io/ebpf-library/libbpf/ebpf/__kconfig/

Signed-off-by: Daniel Hodges <[email protected]>
Copy link
Contributor

@arighi arighi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prevents the libbpf error, but then we may fail to read the right .config values.

Some schedulers for example use CONFIG_HZ, that is evaluated as 0 if __kconfig is not resolved.

So this change looks ok, but we should also change the schedulers to handle this specific use case (CONFIG_HZ == 0), either by setting a fallback value or exiting with a specific error message like "kernel .config not found try installing kernel-headers" or something similar.

Same with other .config values, like CONFIG_NR_CPUS.

@hodgesds hodgesds marked this pull request as draft August 28, 2025 12:40
@multics69
Copy link
Contributor

@hodgesds -- I would be a bit out of context. In the first place, why is the kconfig not properly defined? That seems problematic already.

@hodgesds
Copy link
Contributor Author

@hodgesds -- I would be a bit out of context. In the first place, why is the kconfig not properly defined? That seems problematic already.

On bazzite and some fedora variants they don't ship with kernel configs built in or installed so libbpf fails. Going to resolve this with #2704 as it seems like a better solution.

@hodgesds hodgesds closed this Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants