Re: BPF_CORE_READ issue with nvme_submit_cmd kprobe.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I pulled the latest libbpf-bootstrap and rebuilt my programs. The
error message is clearer now. I think last time I tried
libbpf-bootstrap was still linked to 0.7 instead of 0.8.

The new message is the following which makes sense in regard to what you said.

<invalid CO-RE relocation>
failed to resolve CO-RE relocation <byte_off> [14] struct
nvme_command.common.opcode (0:0:0:0 @ offset 0)
processed 8 insns (limit 1000000) max_states_per_insn 0 total_states 0
peak_states 0 mark_read 0

This struct is part of the nvme driver, which is running on this
system as it only has nvme devices (including boot device). I've been
able to access this data using bpftrace on the same system. If I don't
try to access this struct I can count the correct number of
nvme_submit_cmd triggers, so I believe the probe is working correctly.
Is this a case where I need to define more/all of the struct?

On Tue, May 31, 2022 at 7:22 PM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
>
> On Fri, May 27, 2022 at 3:07 AM John Mazzie <john.p.mazzie@xxxxxxxxx> wrote:
> >
> > While attempting to learn more about BPF and libbpf, I ran into an
> > issue I can't quite seem to resolve.
> >
> > While writing some tools to practice tracing with libbpf, I came
> > across a situation where I get an error when using BPF_CORE_READ,
> > which appears to be that CO-RE relocation failed to find a
> > corresponding field. Compilation doesn't complain, just when I try to
> > execute.
> >
> > Error Message:
> > ---------------------------------------------
> > 8: (85) call unknown#195896080
> > invalid func unknown#195896080
>
> This means CO-RE relocation failed. If you update libbpf submodule (or
> maybe we already did it for libbpf-bootstrap recently), you'll get
> more meaningful error and details. But basically in running kernel
> there is no cmd->common.opcode.
>
> >
> > I'm using the Makefile from libbpf-bootstrap to build my program. The
> > other example programs build and execute properly, and I've also
> > successfully used tracepoints to trace the nvme_setup_cmd and
> > nvme_complete_rq functions. My issue appears to be when I attempt to
> > use kprobes for the nvme_submit_cmd function.
> >
>
> [...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux