Re: [PATCH bpf-next 4/4] docs/bpf: update BPF map definition example

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

 



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.



[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