On Wed, Jan 19, 2022 at 8:01 PM Alexei Starovoitov <ast@xxxxxx> wrote: > > On 1/19/22 2:57 PM, Andrii Nakryiko wrote: > > Use BTF-defined map definition in the documentation example. > > > > Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx> > > --- > > Documentation/bpf/btf.rst | 21 +++++++++------------ > > 1 file changed, 9 insertions(+), 12 deletions(-) > > > > diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst > > index 1ebf4c5c7ddc..07165682da2b 100644 > > --- a/Documentation/bpf/btf.rst > > +++ b/Documentation/bpf/btf.rst > > @@ -565,18 +565,15 @@ A map can be created with ``btf_fd`` and specified key/value type id.:: > > In libbpf, the map can be defined with extra annotation like below: > > :: > > > > - struct bpf_map_def SEC("maps") btf_map = { > > - .type = BPF_MAP_TYPE_ARRAY, > > - .key_size = sizeof(int), > > - .value_size = sizeof(struct ipv_counts), > > - .max_entries = 4, > > - }; > > - BPF_ANNOTATE_KV_PAIR(btf_map, int, struct ipv_counts); > > There is another bpf_map_def in btf.rst. > Maybe convert it as well? Especially considering it's an example of > BTF enabled pretty printing. My bad, not sure how I missed it while grepping. I'll convert that one as well in v2.