Lines Matching refs: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);
102 struct bpf_map_info *info;
107 info = calloc(1, map_info_alloc_len);
108 if (!info)
113 return info;
117 * It returns the fd in "*res_fd" and map_info in "*info".
118 * In the very first iteration, info->id should be 0.
124 * 1: A struct_ops map found. It is returned in "*res_fd" and "*info".
131 struct bpf_map_info *info, __u32 info_len)
133 __u32 id = info->id;
154 err = bpf_map_get_info_by_fd(fd, info, &info_len);
156 p_err("can't get map info: %s", strerror(errno));
161 if (info->type == BPF_MAP_TYPE_STRUCT_OPS &&
162 (!name || !strcmp(name, info->name))) {
179 typedef int (*work_func)(int fd, const struct bpf_map_info *info, void *data,
184 * Then call "func(fd, info, data, wtr)" on each struct_ops map found.
189 struct bpf_map_info *info;
194 info = map_info_alloc(&info_len);
195 if (!info) {
202 while ((err = get_next_struct_ops_map(name, &fd, info, info_len)) == 1) {
204 err = func(fd, info, data, wtr);
231 free(info);
238 struct bpf_map_info *info;
259 info = map_info_alloc(&info_len);
260 if (!info) {
265 if (bpf_map_get_info_by_fd(fd, info, &info_len)) {
266 p_err("can't get map info: %s", strerror(errno));
271 if (info->type != BPF_MAP_TYPE_STRUCT_OPS) {
272 p_err("%s id %u is not a struct_ops map", info->name, info->id);
279 if (func(fd, info, data, wtr))
292 free(info);
313 static int __do_show(int fd, const struct bpf_map_info *info, void *data,
318 jsonw_uint_field(wtr, "id", info->id);
319 jsonw_string_field(wtr, "name", info->name);
321 get_kern_struct_ops_name(info));
324 printf("%u: %-15s %-32s\n", info->id, info->name,
325 get_kern_struct_ops_name(info));
350 static int __do_dump(int fd, const struct bpf_map_info *info, void *data,
368 info->btf_vmlinux_value_type_id);
371 value = calloc(1, info->value_size);
379 info->name, info->id);
386 btf_dumper_type(d, map_info_type_id, (void *)info);
391 btf_dumper_type(d, info->btf_vmlinux_value_type_id, value);
442 static int __do_unregister(int fd, const struct bpf_map_info *info, void *data,
449 get_kern_struct_ops_name(info), info->name,
450 info->id, strerror(errno));
455 get_kern_struct_ops_name(info), info->name,
456 info->id);
496 struct bpf_map_info info = {};
497 __u32 info_len = sizeof(info);
545 if (bpf_map_get_info_by_fd(bpf_map__fd(map), &info,
556 get_kern_struct_ops_name(&info),
557 info.name,
558 info.id);
569 if (linkdir && pin_link(link, linkdir, info.name)) {
571 link_info.id, info.name,
577 get_kern_struct_ops_name(&info),
578 info.name, info.id, link_info.id);