Re: [RFC PATCH v3 06/37] bpf tools: Introduce 'bpf' library to tools

Alexei Starovoitov
2015-05-21T17:53:25Z

On 5/20/15 5:24 PM, Wangnan (F) wrote:
>
>
> Do you think we should classify kprobe/socket programs in libbpf layer
> instead of perf?
>
> In my current implementation, type of a program is determined by perf by
> parsing names of
> corresponding sections. Format of section names should be part of
> interface between perf
> (and iproute2 and others) and eBPF programs. What libbpf should do is to
> fetch those
> names and give them to caller, let caller decide the type of programs.
> Therefore, if
> the program is written for perf, writer of program even don't need to
> think about
> kprobe/socket program type since in perf currently we can only use
> kprobe program.

if whole section name string is passed to perf/iproute2 then it's fine,
but libbpf already parses 'map', 'license', 'version' section names.
Are you saying everything else will be passed to perf directly?
perf will parse section string, generate extra prologue insns based on
debug info found in vmlinux and call into library back to load them?
Sounds ok-ish. Let's see how code looks.