]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scripts/bpf_doc.py: implement json output format
authorIhor Solodrai <isolodrai@meta.com>
Thu, 8 May 2025 20:37:08 +0000 (13:37 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 9 May 2025 18:31:23 +0000 (11:31 -0700)
commitcb4a11925268b13ebcac322775d78bdd4e1b26d3
tree8a2ff44087b31d89076c3783f1e1e02f01bacd17
parentcf15cdc0f0f39a5c6315200808ec3e3995b0c2d2
scripts/bpf_doc.py: implement json output format

bpf_doc.py parses bpf.h header to collect information about various
API elements (such as BPF helpers) and then dump them in one of the
supported formats: rst docs and a C header.

It's useful for external tools to be able to consume this information
in an easy-to-parse format such as JSON. Implement JSON printers and
add --json command line argument.

v3->v4: refactor attrs to only be a helper's field
v2->v3: nit cleanup
v1->v2: add json printer for syscall target

v3: https://lore.kernel.org/bpf/20250507203034.270428-1-isolodrai@meta.com/
v2: https://lore.kernel.org/bpf/20250507182802.3833349-1-isolodrai@meta.com/
v1: https://lore.kernel.org/bpf/20250506000605.497296-1-isolodrai@meta.com/

Signed-off-by: Ihor Solodrai <isolodrai@meta.com>
Tested-by: Quentin Monnet <qmo@kernel.org>
Reviewed-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/r/20250508203708.2520847-1-isolodrai@meta.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
scripts/bpf_doc.py