On Wed, Jul 26, 2023 at 10:25:34AM +0900, Masami Hiramatsu wrote: > Hello, > (I resend this because kconfig was too big) > > I found that BTF is not generated for gcc-built kernel with that latest > pahole (v1.25). hi, I can't reproduce on my setup with your .config does 'bpftool btf dump file ./vmlinux' show any error? is there any error in the kernel build output? > When I'm using the distro origin pahole (v1.22) it works. (I also checked > v1.23 and v1.24, both partially generated BTF) > > e.g. > > # echo 'f kfree $arg*' >> /sys/kernel/tracing/dynamic_events > sh: write error: Invalid argument > > # cat /sys/kernel/tracing/error_log > [ 21.595724] trace_fprobe: error: BTF is not available or not supported > Command: f kfree $arg* > ^ > [ 21.596032] trace_fprobe: error: Invalid $-valiable specified > Command: f kfree $arg* > ^ > > / # strings /sys/kernel/btf/vmlinux | grep kfree hm, if you have this file present, you have BTF in > kfree_on_online > maybe_kfree_parameter > trace_event_raw_rcu_invoke_kfree_bulk_callback > trace_event_data_offsets_rcu_invoke_kfree_bulk_callback > btf_trace_rcu_invoke_kfree_bulk_callback > early_boot_kfree_rcu > __bpf_trace_rcu_invoke_kfree_bulk_callback > perf_trace_rcu_invoke_kfree_bulk_callback > trace_event_raw_event_rcu_invoke_kfree_bulk_callback > trace_raw_output_rcu_invoke_kfree_bulk_callback > __probestub_rcu_invoke_kfree_bulk_callback > __traceiter_rcu_invoke_kfree_bulk_callback > kfree_rcu_cpu_work > kfree_rcu_cpu > kfree_rcu_batch_init > kfree_rcu_scheduler_running > kfree_rcu_shrink_scan > kfree_rcu_shrink_count > kfree_rcu_monitor > kfree_rcu_work > > > Here is the gcc version which I'm using. > > gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04.1) I tried with gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4) and latest pahole (master branch) > > I also attached the kernel config file. > > What is the recommended combination of the tools? > Should I use Clang to build the kernel for BTF? should work fine with both gcc and clang jirka > > Thank you, > > -- > Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>