diff options
| author | Song Liu <[email protected]> | 2019-03-12 05:30:38 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-03-19 19:52:06 +0000 |
| commit | 34be16466d4dc06f3d604dafbcdb3327b72e78da (patch) | |
| tree | ac000724283e4cf8052a9604b71c8f6885d53c2e /tools/bpf/bpftool/prog.c | |
| parent | perf record: Replace option --bpf-event with --no-bpf-event (diff) | |
| download | kernel-34be16466d4dc06f3d604dafbcdb3327b72e78da.tar.gz kernel-34be16466d4dc06f3d604dafbcdb3327b72e78da.zip | |
tools lib bpf: Introduce bpf_program__get_prog_info_linear()
Currently, bpf_prog_info includes 9 arrays. The user has the option to
fetch any combination of these arrays. However, this requires a lot of
handling.
This work becomes more tricky when we need to store bpf_prog_info to a
file, because these arrays are allocated independently.
This patch introduces 'struct bpf_prog_info_linear', which stores arrays
of bpf_prog_info in continuous memory.
Helper functions are introduced to unify the work to get different sets
of bpf_prog_info. Specifically, bpf_program__get_prog_info_linear()
allows the user to select which arrays to fetch, and handles details for
the user.
Please see the comments right before 'enum bpf_prog_info_array' for more
details and examples.
Signed-off-by: Song Liu <[email protected]>
Reviewed-by: Jiri Olsa <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: [email protected]
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stanislav Fomichev <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions
