Re: [PATCH v2 1/2] bpftool: Print map ID upon creation and support JSON output

From: Yonghong Song

Date: Fri Oct 31 2025 - 01:22:16 EST




On 10/30/25 2:06 PM, Harshit Mogalapalli wrote:
It is useful to print map ID on successful creation.

JSON case:
$ ./bpftool -j map create /sys/fs/bpf/test_map4 type hash key 4 value 8 entries 128 name map4
{"id":12}

Generic case:
$ ./bpftool map create /sys/fs/bpf/test_map5 type hash key 4 value 8 entries 128 name map5
Map successfully created with ID: 15

Bpftool Issue: https://github.com/libbpf/bpftool/issues/121
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>

Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>