Em Fri, Nov 13, 2020 at 11:59:23AM +0100, Jiri Olsa escreveu: > On Thu, Nov 12, 2020 at 04:08:02PM -0800, Andrii Nakryiko wrote: > > On Thu, Nov 12, 2020 at 1:14 PM Jiri Olsa <jolsa@xxxxxxxxxx> wrote: > > > On Thu, Nov 12, 2020 at 11:54:41AM -0800, Andrii Nakryiko wrote: > > > > So I can't unfortunately reproduce that GCC bug with DWARF info. What > > > > was exactly the symptom? Maybe you can also share readelf -wi dump for > > > > your problematic vmlinux? > > > hum, can't see -wi working for readelf, however I placed my vmlinux > > > in here: > > > http://people.redhat.com/~jolsa/vmlinux.gz > > > the symptom is that resolve_btfids will fail kernel build: > > > BTFIDS vmlinux > > > FAILED unresolved symbol vfs_getattr > > > because BTF data contains multiple FUNC records for same function > > > and the problem is that declaration tag itself is missing: > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060 > > > so pahole won't skip them > > > the first workaround was to workaround that and go for function > > > records that have code address attached, but that's buggy as well: > > > https://bugzilla.redhat.com/show_bug.cgi?id=1890107 > > > then after some discussions we ended up using ftrace addresses > > > as filter for what we want to display.. plus we got static functions > > > as well > > > however for this way we failed to get proper arguments ;-) > > Right, I followed along overall, but forgot the details of the initial > > problem. Thanks for the refresher. See below for my current thoughts > > on dealing with all this. I'll add this to the set of regression tests I use with pahole: [acme@five vfs_gettattr.multiple.btf.entries.jolsa]$ bpftool btf dump file vmlinux | grep -w FUNC | cut -d\' -f2 | sort | uniq -c | sort -nr | head 3 __x64_sys_userfaultfd 3 __x64_sys_timerfd_settime 3 __x64_sys_timerfd_gettime 3 __x64_sys_timerfd_create 3 __x64_sys_syslog 3 __x64_sys_sysfs 3 __x64_sys_swapon 3 __x64_sys_swapoff 3 __x64_sys_socketpair 3 __x64_sys_socket [acme@five vfs_gettattr.multiple.btf.entries.jolsa]$ pfunct -F btf vmlinux | sort | uniq -c | sort -nr | head 3 __x64_sys_userfaultfd 3 __x64_sys_timerfd_settime 3 __x64_sys_timerfd_gettime 3 __x64_sys_timerfd_create 3 __x64_sys_syslog 3 __x64_sys_sysfs 3 __x64_sys_swapon 3 __x64_sys_swapoff 3 __x64_sys_socketpair 3 __x64_sys_socket [acme@five vfs_gettattr.multiple.btf.entries.jolsa]$ I.e. the output of those tools need to match and all functions need to appear only once. I'll also use pfunct with -F dwarf to get the same results, probably will add these to the 'btfdiff' tool that is in the pahole git repo. - Arnaldo