Lines Matching refs:wtr
450 static void show_map_header_json(struct bpf_map_info *info, json_writer_t *wtr) in show_map_header_json() argument
454 jsonw_uint_field(wtr, "id", info->id); in show_map_header_json()
457 jsonw_string_field(wtr, "type", map_type_str); in show_map_header_json()
459 jsonw_uint_field(wtr, "type", info->type); in show_map_header_json()
462 jsonw_string_field(wtr, "name", info->name); in show_map_header_json()
464 jsonw_name(wtr, "flags"); in show_map_header_json()
465 jsonw_printf(wtr, "%d", info->map_flags); in show_map_header_json()
823 map_dump(int fd, struct bpf_map_info *info, json_writer_t *wtr, in map_dump() argument
841 if (wtr) { in map_dump()
848 jsonw_start_object(wtr); /* map object */ in map_dump()
849 show_map_header_json(info, wtr); in map_dump()
850 jsonw_name(wtr, "elements"); in map_dump()
852 jsonw_start_array(wtr); /* elements */ in map_dump()
872 if (!dump_map_elem(fd, key, value, info, btf, wtr)) in map_dump()
877 if (wtr) { in map_dump()
878 jsonw_end_array(wtr); /* elements */ in map_dump()
880 jsonw_end_object(wtr); /* map object */ in map_dump()
897 json_writer_t *wtr = NULL, *btf_wtr = NULL; in do_dump() local
917 wtr = json_wtr; in do_dump()
927 wtr = btf_wtr; in do_dump()
933 if (wtr && nb_fds > 1) in do_dump()
934 jsonw_start_array(wtr); /* root array */ in do_dump()
940 err = map_dump(fds[i], &info, wtr, nb_fds > 1); in do_dump()
941 if (!wtr && i != nb_fds - 1) in do_dump()
948 if (wtr && nb_fds > 1) in do_dump()
949 jsonw_end_array(wtr); /* root array */ in do_dump()