On 5/11/21 9:17 PM, Andrii Nakryiko wrote:
+ bpf_object__for_each_program(prog, obj) {
+ printf("\tif (skel->links.%1$s_fd > 0) close(skel->links.%1$s_fd);\n",
+ bpf_program__name(prog));
you use bpf_program__name(prog) in so many place that it will be much
simpler if you have a dedicated variable for it
Every time it's in the different loop over all progs.
+ obj = bpf_object__open_file(file, &open_opts);
+ if (IS_ERR_OR_NULL(obj)) {
please use libbpf_get_error() instead of IS_ERR_OR_NULL()
That was copy-pasted from another place in the same file.
Fixed both and the rest of comments.