Re: [PATCH v2 bpf-next] Add support for tracing programs in BPF_PROG_RUN

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

 



On Mon, Feb 6, 2023 at 3:37 PM Martin KaFai Lau <martin.lau@xxxxxxxxx> wrote:
>
> On 2/5/23 9:29 AM, Grant Seltzer Richman wrote:
> > On Sat, Feb 4, 2023 at 1:58 AM Martin KaFai Lau <martin.lau@xxxxxxxxx> wrote:
> >>
> >> On 2/3/23 10:28 AM, Grant Seltzer wrote:
> >>> This patch changes the behavior of how BPF_PROG_RUN treats tracing
> >>> (fentry/fexit) programs. Previously only a return value is injected
> >>> but the actual program was not run.
> >>
> >> hmm... I don't understand this. The actual program is run by attaching to the
> >> bpf_fentry_test{1,2,3...}. eg. The test in fentry_test.c
> >
> > I'm not sure what you mean. Are you saying in order to use the
> > BPF_PROG_RUN bpf syscall command the user must first attach to
> > `bpf_fentry_test1` (or any 1-8), and then execute the BPF_PROG_RUN?
>
> It is how the fentry/fexit/fmod_ret...BPF_PROG_TYPE_TRACIN_xxx prog is setup to
> run now in test_run. afaik, these tracing progs require the trampoline setup
> before calling the bpf prog, so don't understand how __bpf_prog_test_run_tracing
> will work safely.

My goal is to be able to take a bpf program of type
BPF_PROG_TYPE_TRACING and run it via BPF_PROG_TEST_RUN without having
to attach it. The motivation is testing. You can run tracing programs
but the actual program isn't run, from the users perspective the
syscall just returns 0. You can see how I'm testing this here [1].

If I understand you correctly, it's possible to do something like
this, can you give me more information on how I can and I'll be sure
to submit documentation for it?

[1] https://github.com/grantseltzer/bpf-prog-test-run/tree/main/programs

>
> A selftest will help how this will work without the traompline but may be first
> need to understand what it is trying to solve.



[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