lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B7C5D63B-17FC-45F0-85A2-BC0DACAE66D6@fb.com>
Date:   Tue, 8 Dec 2020 18:16:25 +0000
From:   Song Liu <songliubraving@...com>
To:     Jiri Olsa <jolsa@...hat.com>
CC:     lkml <linux-kernel@...r.kernel.org>,
        Kernel Team <Kernel-team@...com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "acme@...nel.org" <acme@...nel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "alexander.shishkin@...ux.intel.com" 
        <alexander.shishkin@...ux.intel.com>,
        "namhyung@...nel.org" <namhyung@...nel.org>
Subject: Re: [PATCH v2 2/2] perf-stat: enable counting events for BPF programs



> On Dec 8, 2020, at 2:24 AM, Jiri Olsa <jolsa@...hat.com> wrote:
> 
> On Tue, Dec 08, 2020 at 01:36:57AM +0000, Song Liu wrote:
> 
> SNIP
> 
>>> 
>>> I'm still getting
>>> 
>>> [root@...l-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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ