Lines Matching defs:info

41 static const char *get_kern_struct_ops_name(const struct bpf_map_info *info)
51 t = btf__type_by_id(kern_btf, info->btf_vmlinux_value_type_id);
104 struct bpf_map_info *info;
109 info = calloc(1, map_info_alloc_len);
110 if (!info)
115 return info;
119 * It returns the fd in "*res_fd" and map_info in "*info".
120 * In the very first iteration, info->id should be 0.
126 * 1: A struct_ops map found. It is returned in "*res_fd" and "*info".
133 struct bpf_map_info *info, __u32 info_len)
135 __u32 id = info->id;
156 err = bpf_obj_get_info_by_fd(fd, info, &info_len);
158 p_err("can't get map info: %s", strerror(errno));
163 if (info->type == BPF_MAP_TYPE_STRUCT_OPS &&
164 (!name || !strcmp(name, info->name))) {
181 typedef int (*work_func)(int fd, const struct bpf_map_info *info, void *data,
186 * Then call "func(fd, info, data, wtr)" on each struct_ops map found.
191 struct bpf_map_info *info;
196 info = map_info_alloc(&info_len);
197 if (!info) {
204 while ((err = get_next_struct_ops_map(name, &fd, info, info_len)) == 1) {
206 err = func(fd, info, data, wtr);
233 free(info);
240 struct bpf_map_info *info;
261 info = map_info_alloc(&info_len);
262 if (!info) {
267 if (bpf_obj_get_info_by_fd(fd, info, &info_len)) {
268 p_err("can't get map info: %s", strerror(errno));
273 if (info->type != BPF_MAP_TYPE_STRUCT_OPS) {
274 p_err("%s id %u is not a struct_ops map", info->name, info->id);
281 if (func(fd, info, data, wtr))
294 free(info);
315 static int __do_show(int fd, const struct bpf_map_info *info, void *data,
320 jsonw_uint_field(wtr, "id", info->id);
321 jsonw_string_field(wtr, "name", info->name);
323 get_kern_struct_ops_name(info));
326 printf("%u: %-15s %-32s\n", info->id, info->name,
327 get_kern_struct_ops_name(info));
352 static int __do_dump(int fd, const struct bpf_map_info *info, void *data,
370 info->btf_vmlinux_value_type_id);
373 value = calloc(1, info->value_size);
381 info->name, info->id);
388 btf_dumper_type(d, map_info_type_id, (void *)info);
393 btf_dumper_type(d, info->btf_vmlinux_value_type_id, value);
444 static int __do_unregister(int fd, const struct bpf_map_info *info, void *data,
451 get_kern_struct_ops_name(info), info->name,
452 info->id, strerror(errno));
457 get_kern_struct_ops_name(info), info->name,
458 info->id);
484 struct bpf_map_info info = {};
485 __u32 info_len = sizeof(info);
531 if (!bpf_obj_get_info_by_fd(bpf_map__fd(map), &info,
534 get_kern_struct_ops_name(&info),
536 info.id);