Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Where is CONFIG_DEBUG_INFO_BTF?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
eborg
n00b
n00b


Joined: 20 Sep 2014
Posts: 11

PostPosted: Wed Dec 27, 2023 8:32 pm    Post subject: [Solved] Where is CONFIG_DEBUG_INFO_BTF? Reply with quote

I have a 6.1.67 kernel and am trying to work with libbpf which calls for a kernel built with CONFIG_DEBUG_INFO_BTF=y. A search in 'menuconfig' says the module is here ...

-> Kernel hacking
-> Compile-time checks and compiler options
-> Generate BTF typeinfo (DEBUG_INFO_BTF [=n])

But when I go there, I do not see the option. How else can I find a way to enable these options witin the kernel?


Last edited by eborg on Thu Dec 28, 2023 1:53 am; edited 1 time in total
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1934

PostPosted: Wed Dec 27, 2023 9:02 pm    Post subject: Reply with quote

If you press 'z' in menuconfig, it may appear and allow you to choose "Help" to show what depending option is missing preventing its selection.
Back to top
View user's profile Send private message
eborg
n00b
n00b


Joined: 20 Sep 2014
Posts: 11

PostPosted: Thu Dec 28, 2023 1:53 am    Post subject: Reply with quote

Thanks for that.
Back to top
View user's profile Send private message
n05ph3r42
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jul 2016
Posts: 135

PostPosted: Wed Nov 27, 2024 6:25 pm    Post subject: Re: [Solved] Where is CONFIG_DEBUG_INFO_BTF? Reply with quote

eborg wrote:
I have a 6.1.67 kernel and am trying to work with libbpf which calls for a kernel built with CONFIG_DEBUG_INFO_BTF=y. A search in 'menuconfig' says the module is here ...

-> Kernel hacking
-> Compile-time checks and compiler options
-> Generate BTF typeinfo (DEBUG_INFO_BTF [=n])

But when I go there, I do not see the option. How else can I find a way to enable these options witin the kernel?


Hi,
Im interested in test of Extensible Scheduler Class, which requires this option too.
Am i correct, that option depends on CLANG as default C compiler? (CC_IS_CLANG)
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5167
Location: Bavaria

PostPosted: Wed Nov 27, 2024 8:48 pm    Post subject: Re: [Solved] Where is CONFIG_DEBUG_INFO_BTF? Reply with quote

n05ph3r42 wrote:
Im interested in test of Extensible Scheduler Class, which requires this option too.
Am i correct, that option depends on CLANG as default C compiler? (CC_IS_CLANG)

Although the kernel documentation [1] does not mention it, ninja and clang are used here [2].

1) https://www.kernel.org/doc/html/next/scheduler/sched-ext.html
2) https://speakerdeck.com/shun159/learning-sched-ext-bpf-extensible-scheduler-class
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1725
Location: South America

PostPosted: Thu Nov 28, 2024 3:10 am    Post subject: Re: [Solved] Where is CONFIG_DEBUG_INFO_BTF? Reply with quote

n05ph3r42 wrote:
Im interested in test of Extensible Scheduler Class, which requires this option too.
Am i correct, that option depends on CLANG as default C compiler? (CC_IS_CLANG)

I don't think that you need to build the kernel with Clang (CC_IS_CLANG=y), but it seems that you do need Clang for creating BPF programs.

According to the README.md file in tools/sched_ext/ for version 6.12.1:

Quote:
Compiling the examples

There are a few toolchain dependencies for compiling the example schedulers.

Toolchain dependencies

1. clang >= 16.0.0

The schedulers are BPF programs, and therefore must be compiled with clang. gcc is actively working on adding a BPF backend compiler as well, but are still missing some features such as BTF type tags which are necessary for using kptrs.

And the makefile uses this recipe for compiling *.bpf.c files:

Code:
$(SCXOBJ_DIR)/%.bpf.o: %.bpf.c $(INCLUDE_DIR)/vmlinux.h include/scx/*.h      \
             | $(BPFOBJ) $(SCXOBJ_DIR)
   $(call msg,CLNG-BPF,,$(notdir $@))
   $(Q)$(CLANG) $(BPF_CFLAGS) -target bpf -c $< -o $@

That is, clang -target bpf -c.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum