On May 28, 2020 5:50:52 PM GMT-03:00, Hao Luo <haoluo@xxxxxxxxxx> wrote: >A quick update on this thread. > >I came up with a draft patch that fulfills step 1. I added a ".ksym" >section for extern vars. The libbpf fills these vars' values by reading >/proc/kallsyms at load time. I think I am going to upload this patch >for >review together with step 3 and 4 after I work them out. > >Regarding step 2, I have also worked out a patch in pahole that inserts >the >kernel's percpu vars into BTF. I realized, because step 2 happens at >compile time, there is no kallsyms file available to extract symbols, >so we >have to read the global vars from vmlinux. Currently on v5.7-rc7, I was >able to extract 291 percpu vars, static or global. The .BTF size >increases >from 2d2c10 to 2d4dd0. A clean build on my local workstation increases >from >10m13s to 11m24s (wall time). Common global percpu vars can be found in >.BTF. > >haoluo@haoluo:~/kernel/tip/pkgs/images/boot$ bpftool btf dump file >vmlinux-5.7.0-smp-DEV | grep runqueues > >[14098] VAR 'runqueues' type_id=13725, linkage=global-alloc > >haoluo@haoluo:~/kernel/tip/pkgs/images/boot$ bpftool btf dump file >vmlinux-5.7.0-smp-DEV | grep cpu_stopper > >[17589] STRUCT 'cpu_stopper' size=72 vlen=5 >[17609] VAR 'cpu_stopper' type_id=17589, linkage=global-alloc > >Arnaldo, would you please advise on how to upload the pahole patch for >review? I am going to polish it a bit and think I can upload it for >review. Cool, send it to me, CC dwarves@xxxxxxxxxxxxxxx, Thanks, - Arnaldo -- Sent from my Android device with K-9 Mail. Please excuse my brevity.