Re: Portability of bpf_tracing.h
From: Alexei Starovoitov <hidden>
Date: 2021-06-10 18:15:17
From: Alexei Starovoitov <hidden>
Date: 2021-06-10 18:15:17
On Thu, Jun 10, 2021 at 7:12 AM Lorenz Bauer [off-list ref] wrote:
quoted
quoted
The idea of basing this on unique fields in types is neat, the downside I see is that we encode the logic in the BPF bitstream. If in the future struct pt_regs is changed, code breaks and we can't do muchIf pt_regs fields are renamed all PT_REGS-related stuff, provided by libbpf in bpf_tracing.h will break as well and will require re-compilation of BPF application.I'm thinking more along the lines of, if a PT_REGS definition changes so that the unique field isn't unique anymore. The BPF is still valid, but the logic that determines the platform isn't.
struct pt_regs is uapi on every arch. They cannot change. New registers can be added :) but the chance is close to zero.