lkml.org 
[lkml]   [2020]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 2/2] perf-stat: enable counting events for BPF programs
Date


> On Dec 8, 2020, at 2:24 AM, Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Tue, Dec 08, 2020 at 01:36:57AM +0000, Song Liu wrote:
>
> SNIP
>
>>>
>>> I'm still getting
>>>
>>> [root@dell-r440-01 perf]# ./perf stat -b 38
>>> libbpf: elf: skipping unrecognized data section(9) .eh_frame
>>> libbpf: elf: skipping relo section(15) .rel.eh_frame for section(9) .eh_frame
>>> libbpf: XXX is not found in vmlinux BTF
>>> libbpf: failed to load object 'bpf_prog_profiler_bpf'
>>> libbpf: failed to load BPF skeleton 'bpf_prog_profiler_bpf': -2
>>> ...
>>>
>>> with id 38 being:
>>>
>>> 38: tracepoint name sys_enter tag 03418b72a610af75 gpl
>>> loaded_at 2020-12-07T22:54:05+0100 uid 0
>>> xlated 272B jited 153B memlock 4096B map_ids 1
>>>
>>> how is this supposed to work when there's XXX in the
>>> program's section? libbpf is trying to find XXX in
>>> kernel BTF and fails of course
>>
>> I think this is because this program doesn't have BTF. The actual failed
>> function was bpf_program__set_attach_target(). So the error message above
>> should be "Failed to _open_ bpf skeleton". I will fix the error messages.
>
> ah right, it's bpftrace program, so there's no BTF loaded for the program
> I'll check if there's a way to add it, it'd be shame not to have this
> feature for bpftrace programs
>
> there's no way around it, right? we need btf id of the program to attach
> fentry/fexit to it

Yes, we do need BTF here (in bpf_program__set_attach_target).
>
> I think we need to fail the function if there's error detected,
> and also check on the prog_name and fail if it's not found
>
> plus change all those pr_debug to pr_err in bpf_program_profiler_load_one

I fixed these in the next version.

Thanks,
Song


\
 
 \ /
  Last update: 2020-12-08 19:18    [W:0.085 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site